Having watched the last Harry Potter film, little Gerald also decided to practice magic. He found in his father's magical book a spell that turns any number in the sum of its digits. At the moment Gerald learned that, he came across a number *n*. How many times can Gerald put a spell on it until the number becomes one-digit?
The first line contains the only integer *n* (0 ≤ *n* ≤ 10<sup class="upper-index">100000</sup>). It is guaranteed that *n* doesn't contain any leading zeroes.
0
0
10
1
991
3
99
2
100
1
123456789
2
32
1
86
2
2
0
8
0
34
1
13
1
28
2
23
1
57
2
29
2
353869285
3
549548646
2
858893424
2
644818852
3
360322525
3
122937520
2
288403032
2
677257481
3
58059561
3
211288847
2
339900034079539584
2
784084029310269952
3
774730557264864000
3
478233807148352256
3
165646874056812544
3
477533739511673792
3
660119944377002240
3
448375218506078080
3
77213334785795616
3
165767221702271872
3
1
0
5
0
8
0
156161456146164104103460452045416165146141414651641564105461465156445621465146514562146145465165145145614561465145614561
3
9
0
"Codeforces Round #339 (Div. 2)"
"B. Gena's Code"
# y=int(input())
# # a=list(map(int,input().split()))
# a=list(input().split())
# nz=0
# nb=''
# z=0
# # print(len(str(z)))
# for i in a:
#     if i=='0':
#         z=1
#         break
#     else:
#         s='1'
#         l=(len(i)-1)
#         qz='0'*l
#         s+=qz
#         if s==i:
#             nz+=l
#         else:
#             nb=i
# if nb=='':
#     nb='1'            
# ans=nb+('0'*nz)
# if z==1:
#     ans='0'
# print(ans)                
"Codeforces Round #177 (Div. 2)"
"B. Polo the Penguin and Matrix"
# n,m,d=map(int,input().split())
# a=[]
# for i in range(n):
#     b=list(map(int,input().split()))
#     a.extend(b)
# a.sort()
# fa=a[0]
# f=0
# c=(a[len(a)//2]-fa)//d
# moves=0
# for i in a:
#     if (i-fa)%d>0:
#         f=-1
#     moves+=abs(int((i-fa)/d)-c)
# if f==-1:
#     print(-1)
# else:
#     print(moves)            
"Codeforces Round #264 (Div. 2)"
"B. Caisa and Pylons"
# y=int(input())
# a=list(map(int,input().split()))
# mini=0
# p=-a[0]
# for i in range(1,y):
#     if p<mini:
#         mini=p
#     p=p+a[i-1]-a[i]   
# if p<mini:
#     mini=p    
# if mini<0:
#     print(-1*mini)
# else:
#     print(0)         
"Codeforces Beta Round #79 (Div. 2 Only)"
"B. Sum of Digits"
y=input()
def sumofdigits(s):
    ans=0
    for i in s:
        ans+=int(i)
    return ans
n=0    
while len(y)>1:
    n+=1
    y=str(sumofdigits(y))        

print(n)
