Having watched the last Harry Potter film, little Gerald also decided to practice magic. He found in his father's magical book a spell that turns any number in the sum of its digits. At the moment Gerald learned that, he came across a number *n*. How many times can Gerald put a spell on it until the number becomes one-digit?
The first line contains the only integer *n* (0 ≤ *n* ≤ 10<sup class="upper-index">100000</sup>). It is guaranteed that *n* doesn't contain any leading zeroes.
0
0
10
1
991
3
99
2
100
1
123456789
2
32
1
86
2
2
0
8
0
34
1
13
1
28
2
23
1
57
2
29
2
353869285
3
549548646
2
858893424
2
644818852
3
360322525
3
122937520
2
288403032
2
677257481
3
58059561
3
211288847
2
339900034079539584
2
784084029310269952
3
774730557264864000
3
478233807148352256
3
165646874056812544
3
477533739511673792
3
660119944377002240
3
448375218506078080
3
77213334785795616
3
165767221702271872
3
1
0
5
0
8
0
156161456146164104103460452045416165146141414651641564105461465156445621465146514562146145465165145145614561465145614561
3
9
0
#include <bits/stdc++.h>
#define ll long long
#define ld long double
#define FIO ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
using namespace std;
//subset
void subset(ll *ar,ll n)
{
    for(ll i=0; i<(1LL<<n); i++)
    {
        for(ll j=0; j<n; j++)
            if(((1LL<<j)&i))//do something;

                cout<<"\n";
    }

}

//ncr
ll ncr(ll n, ll r)
{
    if(n-r < r)
        r= n-r;
    ll res=1;
    for(ll i=1; i<=r; i++,n--)
    {
        res*=n;
        res/=i;
    }
    return res;
}
//npr
ll npr(ll n, ll r)
{
// n!/(n-r)!
//1*2*3*4*5*6*7*8*9*10
//1*2*3*4*5*6
    ll res=1;
    for(ll i=n; i>(n-r); i--)res*=i;
    return res;
}
//sieve prime
const ll n=1e7;
vector<bool>sieve(n+1,true);
void sieve_prime(ll N)
{
    sieve[1]=false;
    for(ll i=2; i*i<=N; i++)
        if(sieve[i])
            for(ll j=i*i; j<=N; j+=i)
                sieve[j]=false;
}
//fast power
ll fastpower(ll a, ll b)
{
    if(b==0)return 1;
    ll x=fastpower(a,b/2);
    if(b%2==0)return x*x;
    else return a * x * x;
}

//gcd
ll gcd(ll num1,ll num2)
{
    ll temp;

    while(num2)
    {
        temp = num1;
        num1 = num2;
        num2= temp % num1;
    }
    return num1;

}
//lcm
int lcm(int num1, int num2)
{

    return num1*(num2/gcd(num1,num2));
}
//sub string function
int isSubstring(string s1, string s2)
{
    int M = s1.length();
    int N = s2.length();

    /* A loop to slide pat[] one by one */
    for (int i = 0; i <= N - M; i++)
    {
        int j;

        /* For current index i, check for
        pattern match */
        for (j = 0; j < M; j++)
            if (s2[i + j] != s1[j])
                break;

        if (j == M)
            return 1;
    }

    return 0;
}
//sub sequence sstring

bool issubsequence(string& s1,string& s2,ll mid,ll *ar)
{
    ll i = 0, j = 0;
    ll m=s1.size();
    ll n=s2.size();
    for(int i=0; i<=mid; i++)s2[ar[i]]='#';
    while (i < m && j < n)
    {
        if (s1[i] == s2[j])
            i++;
        j++;
    }
    return i == n;
}

int ret(string s,string ok)
{
    if (ok.find(s) != string::npos)
    {
        return ok.find(s);
    }
    return -1;
}
bool primeFactors(ll n)
{
    ll c=2;
    unordered_map<ll,bool>mp;

    while(n>1)
    {
        if(n%c==0)
        {
            if(mp[c]==0)mp[c]=1;
            n/=c;
        }
        else c++;
        if(mp.size()>2)return 0;
    }
    return mp.size()==2;
}

//fast-power-mod
ll fastpower_mod(ll a, ll b, ll mod)
{
    a%=mod;
    ll ans=1;
    while(b>0)
    {
        if(b%2)
            ans=(ans*a)%mod;
        a=(a*a)%mod;
        b/=2;
    }
    return ans;
}
//fix mod
ll fixMod(ll a, ll b)
{
    return (a%b+b)%b;
}
// multiples
vector<ll>get_multi(ll num , ll n)
{
vector<ll>v;
for(ll i=num;i<=n;i+=num)
v.push_back(i);

return v;
}
// isprime ???
bool isprime(ll n)
{
if(n%2==0)return false;
if(n<=1)return false;
for(ll i=2;i*i<=n;i++)
if(!n%i)return false;
return true;

}
// print all divisor
vector<ll> divisors(ll num)
{
    vector<ll>div;
    ll i=1;
    for(i=1; i*i<num; i++)
    {
        if(num%i==0)
        {
            div.push_back(i);
            div.push_back(num/i);
        }
    }
    if(i*i==num)
    {
        div.push_back(i);
        //cerr<<i;
    }
    return div;
}

void solve()
{

string s;
cin>>s;
ll c=0;
ll n=s.size();
while(s.size()>1)
{
ll sum=0;
n=s.size();
for(ll i=0;i<n;i++)sum+=s[i]-'0';
c++;
s=to_string(sum);
}
cout<<c<<'\n';

}


////////////////////////////<main>////////////////////////////
int main()
{
    FIO;
    ll q;
    q=1;
    //cin>>q;
    while(q--)
    {
        solve();

    }
    return 0;
}
/*

 */
