#include<bits/stdc++.h>
using namespace std;

#define int long long

#define rep(i,n) for(int i=0;i<(n);i++)
#define pb push_back
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second
typedef vector<int>vint;
typedef pair<int,int>pint;
typedef vector<pint>vpint;

template<typename A,typename B>inline void chmin(A &a,B b){if(a>b)a=b;}
template<typename A,typename B>inline void chmax(A &a,B b){if(a<b)a=b;}

int L;
int A[555555];

signed main(){
    string s;cin>>s;
    reverse(all(s));
    L=s.size();
    rep(i,L)A[i]=s[i]-'0';

    rep(i,L)A[i]*=9;
    rep(i,L+10){
        A[i+1]+=A[i]/10;
        A[i]%=10;
    }

    int sum=0;
    rep(i,555555)sum+=A[i];


    for(int i=0;;i++){
        if(sum<=i&&(i-sum)%9==0){
            cout<<(i+8)/9<<endl;
            return 0;
        }

        for(int j=0;;j++){
            A[j]++;
            sum++;
            if(A[j]!=10)break;
            sum-=10;
            A[j]=0;
        }
    }
    return 0;
}
