#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <cmath>
using namespace std;
const int N=1000010;
int n;
int a[N];
char s[N];
inline int gi() {
    int x=0,o=1;
    char ch=getchar();
    while(ch!='-'&&(ch<'0'||ch>'9')) ch=getchar();
    if(ch=='-') o=-1,ch=getchar();
    while(ch>='0'&&ch<='9') x=x*10+ch-'0',ch=getchar();
    return x*o;
}
inline bool check(int k) {
    for(int i=0;i<n;i++) a[i]=9*(s[i]-'0');
    int m=n,ans=0;
    a[0]+=9*k;
    for(int i=0;i<m;ans+=a[i++]%10)
	if(a[i]>9) {
	    if(i==m-1) a[m++]=0;
	    a[i+1]+=a[i]/10;
	}
    return ans<=k*9;
}
int main() {
    scanf("%s",s);
    n=strlen(s),reverse(s,s+n);
    int l=1,r=n;
    while(l<=r) {
	int mid=(l+r)>>1;
	if(check(mid)) r=mid-1;
	else l=mid+1;
    }
    cout<<l;
    return 0;
}