The number of digits used to write all the page numbers in a book is 35. How many pages has the book?