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
#https://dmoj.ca/problem/ccc20j1
'''
s = int(input())
m = int(input())
l = int(input())
hscore = 1 * s + 2 * m + 3 * l
if hscore >= 10:
    print("happy")
else:
    print("sad")
'''
#https://dmoj.ca/problem/ccc19j1
'''
A3 = int(input())
A2 = int(input())
A1 = int(input())
a = A3 * 3 + A2 * 2 + A1
B3 = int(input())
B2 = int(input())
B1 = int(input())
b = B3 * 3 + B2 * 2 + B1

if a > b:
    print("A")
elif b > a:
    print("B")
else:
    print("T")
'''
#https://codeforces.com/problemset/problem/129/A
'''
bags = int(input())
cookies = input().split(" ")
intc = []
num = 0
for c in cookies:
    intc.append(int(c))
for i in range(bags):
    remainingc = sum(intc) - intc[i]
    if remainingc % 2 == 0:
        num += 1
print(num)
'''
#https://www.spoj.com/BSCPROG/problems/SMPWOW/
'''
ocount = int(input())
print("W", ocount * "o", "w", sep="")
'''
#https://www.spoj.com/BSCPROG/problems/SMPSUM/
'''
sum = 0
nums = input().split()
intnums = [int(num) for num in nums]
i = intnums[0]
while i <= intnums[1]:
    sum += i**2
    i+=1
print(sum)
'''
#https://www.spoj.com/BSCPROG/problems/SMPSEQ7/
'''
n = int(input())
i = 0
listS = input().split()
intS = [int(s) for s in listS]
cansplit = True
hassplit = False
while i < n-1:
    if intS[i] < intS[i+1]:
        if hassplit == False:
            hassplit = True
            i+=1
            continue
        elif hassplit == True:
            i+=1
            continue
    if intS[i] == intS[i+1]:
        if hassplit == False:
            hassplit = True
            i+=1
            continue
        elif hassplit == True:
            cansplit = False
            break
    if intS[i] > intS[i+1]:
        if hassplit == False:
            i+=1
            continue
        elif hassplit == True:
            cansplit = False
            break

if cansplit:
    print("Yes")
else:
    print("No")

'''
#https://dmoj.ca/problem/ccc17j2
'''
n = int(input())
k = int(input())
sum = 0
while k >= 0:
    shift = 10**k
    sum+= n*shift
    k-=1
print(sum)
'''
#https://dmoj.ca/problem/ccc18j2
'''
n = int(input())
l1 = input()
l2 = input()
i = 0
occupied = 0
while i < n:
    if l1[i] == l2[i] and l1[i] == "C":
        occupied+=1
    i+=1
print(occupied)
'''
#https://dmoj.ca/problem/ccc19j2
'''
L = int(input())
output = ''
for i in range(L):
    msg = input().split()
    output += int(msg[0]) * msg[1] + "\n"
print(output)
'''
#https://dmoj.ca/problem/ccc20j2
'''
P = int(input())
N = int(input())
R = int(input())
T = N
day = 0
while T <= P:
    N = N*R 
    T += N
    day+=1
print(day)
'''
#https://dmoj.ca/problem/ccc21j2
'''
N = int(input())
bids = []
bidders = []
for i in range(N):
    bidders.append(input())
    bids.append(int(input()))
biddernum = bids.index(max(bids))
print(bidders[biddernum])
'''
#https://codeforces.com/problemset/problem/231/A
'''
n = int(input())
solutions = 0
for i in range(n):
    confidence = input().split()
    if confidence.count("1") >= 2:
        solutions += 1
print(solutions)
'''
#https://codeforces.com/problemset/problem/236/A
'''
username = input()
userchars = set(username)
if len(userchars) % 2 == 1:
    print("IGNORE HIM!")
else:
    print("CHAT WITH HER!")
'''
#https://codeforces.com/problemset/problem/567/A
'''
n = int(input())
coords = input().split()
i = 0
icoords = [int(city) for city in coords]
while i < n:
    distance = [abs(coord - icoords[i]) for coord in icoords if coord != icoords[i]]
    print(min(distance), max(distance))
    i+=1
'''
#https://codeforces.com/problemset/problem/208/A
'''
remixed = input().split("WUB")
initial = [word for word in remixed if word != ""]
lyrics = ""
for lyric in initial:
    lyrics+=lyric + " "
print(lyrics)
'''
#https://codeforces.com/problemset/problem/443/A
'''
numset = input().lstrip("{").rstrip("}").split(", ")
words = ""
for num in numset:
    words+=num
letters = set(words)
print(len(letters))
'''
#https://codeforces.com/problemset/problem/520/A
'''
n = int(input())
pangram = input()
chars = set(pangram.lower())
if len(chars) == 26:
    print("YES")
else:
    print("NO")
'''
#https://codeforces.com/problemset/problem/102/B
n = int(input())
spelluses = 0
while len(str(n)) != 1:
    n = sum(int(num) for num in str(n))
    spelluses+=1
print(spelluses)

