e-olymp
favorite We need a little bit of your help to keep things running, click on this banner to learn more

Book

Misha sometimes read books. But it did a strange way: he always began with the first page and read the daily exactly as many pages as is the sum of digits of the page at which he began to read some day. That is, the first day, he read one page, then two, four, eight and so on. Help her father Misha figure out what day of his son reading a book, if it's Mike reads the k-th page of the book.

Input

Integer k (0 < k < 5000) - page number, which now reads, Misha.

Output

An integer indicating which day Mike is reading a book.

Time limit 1 second
Memory limit 122.17 MiB
Input example #1
20
Output example #1
5