n=int(input()) def f(x): if x<10: return 0 a=1 for i in range(30): if 10**i<=x: to=i for i in range(to+1): a=a*((x//(10**i))%10) return 1+f(a) print(f(n))