import math def ilog10(x): tmp=int(math.log10(x)) # if x<10**tmp: # return tmp-1 return tmp def MUL(x): res=1 for i in range(ilog10(x)+1): res*=(x//(10**i))%10 return res def f(x): if x<10: return 0 else: return 1+f(MUL(x)) print(f(int(input())))