#include <bits/stdc++.h>
using namespace std;
int i,j,m;
 ifstream f1("SOGB.INP");
    ofstream f2("SOGB.OUT");
long long tich(long long n)
{  long long t=1;
    while (n>0)
    {m=n%10;
     t=t*m;
     n=n/10;
    }
    return t;
}
int doben(long long n)
    {   int d=0;
        while (n>=10)
    {
        n=tich(n);
        d++;
    }
    return d;}
    int main()
    {
        long long n;
        f1>>n;
        f2<<doben(n);

     return 0;
}
