def f(x): if x < 10: return 0 m = 1 while x: m *= x % 10 x //= 10 return 1 + f(m) n = int(input()) assert 0 <= n < 2**63 print(f(n))