n = int(input())
new = n
count = 0
while 1:
    n1 = int(new / 10)
    n2 = new % 10
    new = ((n1 + n2) % 10) + (n2 * 10)
    count += 1
    if new == n:
        break
print(count)

a8443f0c598c3149a83a6a58b1424e75e0efcf1a
<mask token>

<mask token>
while 1:
    n1 = int(new / 10)
    n2 = new % 10
    new = (n1 + n2) % 10 + n2 * 10
    count += 1
    if new == n:
        break
print(count)

n = int(input())
new = n
count = 0
while 1:
    n1 = int(new / 10)
    n2 = new % 10
    new = (n1 + n2) % 10 + n2 * 10
    count += 1
    if new == n:
        break
print(count)

n = int(input())
new = n
count = 0
while 1:
    n1 = int(new / 10)
    n2 = new % 10
    new = ((n1 + n2) % 10) + (n2 * 10)
    count += 1
    if new == n:
        break
print(count)
