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
'''Author : seraph14'''
import sys, io, os
import heapq
if 'PyPy' in sys.version:
    from _continuation import continulet
else:
    import threading
# input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
input = sys.stdin.readline

hqp = heapq.heappop
hqs = heapq.heappush

############ ---- Output Function ---- ############
def _print(*argv, sep=" "):
    sys.stdout.write(sep.join(map(str, argv)) + "\n")

############ ---- Input Functions ---- ############
def inp():
    return (int(input()))

def inlt():
    return (list(map(int, input().split())))

def insr():
    if input == sys.stdin.readline:
        s = input()
        return list(s.strip())
    else:
        s = input().decode()
        return (list(s[:len(s)-2]))

def invr():
    return (map(int, input().split()))

def get_bool(right):
    return "YES" if right else "NO"

def solve():
    pass

def main():
    n = insr()
    c = 0
    while len(n) > 1:
        c += 1
        n = list(str(sum(map(int, n))))

    _print(c)

if __name__ == '__main__':
    if 'PyPy' in sys.version:

        def bootstrap(cont):
            call, arg = cont.switch()
            while True:
                call, arg = cont.switch(
                    to=continulet(lambda _, f, args: f(*args), call, arg))
        cont = continulet(bootstrap)
        cont.switch()
        main()
    else:
        sys.setrecursionlimit(1 << 30)
        threading.stack_size(1 << 27)

        main_thread = threading.Thread(target=main)
        main_thread.start()
        main_thread.join()