eolymp
bolt
Try our new interface for solving problems
Problems

Removing Digits

Removing Digits

Time limit 1 second
Memory limit 128 MiB

You are given an integer n. 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 0?

Input data

One integer n (1n10^6).

Output data

Print one integer: the minimum number of steps.

Examples

Input example #1
27
Output example #1
5

Note

An optimal solution is 2720181090.