n=int(input()) a=0 while n>9: p=1 while n:p*=n%10;n//=10 a+=1;n=p print(a)