Book#577

Book

1 second
64 megabytes
Very easy

Besides watching the office from his window, Vasya also read a book during the summer. To make reading less boring, he counted the number of digits required to number all the pages in the book. As a result, he obtained digits.

Vasya remembers that the first three pages of the book were not numbered. The numbered pages start from the th page (with the number on this page, on the next, and so on).

Now Vasya is wondering how many pages there were in the book he read.

Input

A single natural number (1 \leq N \leq 10000) is given — the number of digits used for numbering the pages of the book.

Output

Output the total number of pages in the book. It is guaranteed that Vasya did not make a mistake in the calculations, and there is always a solution.

Examples

Example 1

Loading
Loading