https://www.acmicpc.net/problem/1110
def change(n):
a=int(n/10)
b=n%10
c=a+b
return b*10+c%10
n=input()
n=int(n)
t=1
num=change(n)
if n==0:
print(1)
else:
while 1:
num=change(num)
t+=1
if num==n:
print(t)
break