# from PIL import Image # img = Image.open("./hoge.png") # N,M = img.size # d = [] # for i in range(N): # for j in range(M): # d.append(chr(img.getpixel((i,j)))) # with open("fuga.html",mode="w",encoding="utf-8") as f: # f.write("".join(d)) import sys, math input = lambda: sys.stdin.readline()[:-1] def MI(): return map(int, input().split()) inf = 10**18 sys.setrecursionlimit(10**7) # Codeforcesでは350000程度に def f(x): if x < 10: return 0 res = 1 for i in range(math.floor(math.log10(x))+1): res *= x//(10**i)%10 return 1 + f(res) print(f(int(input())))