You are given a natural number . You can perform the following two operations:
1. Subtract any digit of from .
2. You can repeat the first operation on the resulting number.
Your task is to reduce the number to zero using these operations. What is the minimum number of operations required?
The input contains a single integer (1 \leq n \leq 10^6).
Output the minimum number of operations needed to make the number equal to zero.
In the example: 27 → 20 → 18 → 10 → 9 → 1 — the process takes a minimum of 5 steps.
Example 1