Removing Digits#9037

Removing Digits

1 second
128 megabytes
Very easy

You are given an integer . On each step, you may subtract from it any one-digit number that appears in it.

How many steps are required to make the number equal to ?

Input

One integer ( ≤ ≤ 10^6).

Output

Print the minimum number of steps to get the number .

Examples

Example 1

Loading
Loading

Note

For =

An optimal solution is → → → → → .