Time

10:59:23
11 Feb 2012
ACM-ICPC Thailand Southern Region Programming Contest 2011
Left: 4 hours 1 minutes
End: 11.02.2012 15:00
Leader: Informatimukas
Five for week 22
Left: 11 hours 1 minutes
End: 11.02.2012 22:00
Leader: NuM
Version for print

How many times to repeat?

   The positive integer number N is given. We subtract from this number the sum of its digits. From the received number we soon subtract the sum of its digits and so on. This operation continues until the number is positive. How many times this operation will be repeated?


Specifications

   Input

   The number N, 0 < N < 2000000000.

   Output

   The number of performed operations.


Problem information

Time Limit: 10 seconds
Memory Limit: 64 MB
Balls for the passed test: 10
Complexity: 29% 703/988

Example

Example input

23

Example output

3


← Degree of symmetry Problems Corruption →