codeforces#P1157A. Reachable Numbers
Reachable Numbers
Description
Let's denote a function in such a way: we add to , then, while there is at least one trailing zero in the resulting number, we remove that zero. For example,
- : ;
- : ;
- : ;
- : .
We say that some number is reachable from if we can apply function to some (possibly zero) times so that we get as a result. For example, is reachable from because ; and any number is reachable from itself.
You are given a number ; your task is to count how many different numbers are reachable from .
The first line contains one integer ().
Print one integer: the number of different numbers that are reachable from .
Input
The first line contains one integer ().
Output
Print one integer: the number of different numbers that are reachable from .
Samples
Note
The numbers that are reachable from are:
.