Repeat: how many times to repeat? #481

Repeat: how many times to repeat?

1 second
64 megabytes
Hard

Given a positive integer . At each step, subtract the sum of its digits from . Repeat this operation on the resulting number as long as it remains positive. How many times will this operation be performed?

Input

The number (0 < N \leq 2147483647).

Output

Output the number of performed operations.

Examples

Example 1

Loading
Loading