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 while x: res *= x%10 x //= 10 return 1 + f(res) print(f(int(input())))