Very easy

Execution time limit is 1 second

Runtime memory usage limit is 128 megabytes

For numbering m pages in the book n digits were used. By given n output the corresponding m or 0 if there is no solution. Numbering starts from first page.

The only number n. The book contains no more than 7000 pages.

Print the number of pages in the book.

Input #1

Answer #1