Digit Subtraction#274

Digit Subtraction

1 second
128 megabytes
Medium (≈1350)

You are given a natural number . At each step, you can subtract one of its digits from this number.

What is the minimum number of steps to make the number equal to ?

Input

A natural number is given (1 ≤ n ≤ 10^6).

Output

Output the minimum number of steps.

Examples

Example 1

Loading
Loading

Note

The optimal solution for the example is as follows: 27 → 20 → 18 → 10 → 9 → 0.