To number pages in a book, a total of digits are used. Given , determine the number of pages if such exists; otherwise, output 0. Numbering starts with page .
The only input is an integer . The book contains no more than pages.
Output the number of pages in the book. If no such exists, output 0.
Example 1