Book
During the summer, Vasylko spent his time not only watching the office from his window but also reading a book. To make his reading more engaging, he counted the total number of digits used to number the pages of the book. He found that the total number of digits was N.
Vasylko recalls that the first three pages of the book were not numbered. The numbering began on the 4th page, where the number 4 was written, followed by 5 on the next page, and so forth.
Now, Vasylko is curious to determine the total number of pages in the book he read.
Input
You are given a single natural number N (1 ≤ N ≤ 10000), which represents the total number of digits used for numbering the pages of the book.
Output
Output the total number of pages in the book. It is assured that Vasylko's calculations are correct, and a solution always exists.