#define _USE_MATH_DEFINES #pragma GCC target("avx2") #pragma GCC optimize("O3") #define _USE_MATH_DEFINES #include #include #include #include #include using namespace std; #define LP(I,S,G) for (long long int I = (S); I < (G); ++I) #define IN(X) for (int in = 0; in < X.size(); in++)cin >> X[in] #define OUT(X) for (int in = 0; in < X.size(); in++)cout << X[in]<<" " #define SORT(X) sort((X).begin(), (X).end()) #define CSORT(X,Y) sort(X.begin(), X.end(),Y) #define COPY(X,Y) copy(X.begin(), X.end(), Y.begin()) #define ALL(X,Y) for (auto X = (Y).begin(); X != (Y).end(); X++) #define FULL(a) (a).begin(),(a).end() #define BFS(Q,S) for(Q.push(S);Q.size()!=0;Q.pop()) typedef long long int ll; typedef unsigned long long int ull; long long int M = 998244353; int dx[] = { -1,0,1,0 }, dy[] = { 0,1,0,-1 }; ll MAX(ll A, ll B) { return ((A) > (B) ? (A) : (B)); } ll MIN(ll A, ll B) { return ((A) < (B) ? (A) : (B)); } long long int xor128() { static long long int x = 123456789, y = 362436069, z = 521288629, w = 88675123; long long int t = (x ^ (x << 11)); x = y; y = z; z = w; return (w = (w ^ (w >> 19)) ^ (t ^ (t >> 8))); } struct HashPair { //注意 constがいる template size_t operator()(const pair &p) const { //first分をハッシュ化する auto hash1 = hash{}(p.first); //second分をハッシュ化する auto hash2 = hash{}(p.second); //重複しないようにハッシュ処理 size_t seed = 0; seed ^= hash1 + 0x9e3779b9 + (seed << 6) + (seed >> 2); seed ^= hash2 + 0x9e3779b9 + (seed << 6) + (seed >> 2); return seed; } }; template istream& operator>>(istream& s, pair& in) { s >> in.first >> in.second; return s; } ll f(ll x) { if (x < 10)return 0; ll v = 1; string s = to_string(x); ALL(i, s)v *= *i - '0'; return f(v) + 1; } int main() { ll n; cin >> n; cout << f(n) << "\n"; return 0; }