#include<cstdio>
#include<cstring>
#include<algorithm>
int n;
char s[500005];
int t[500005],sm;
int main(){
	scanf("%s",s+1);
	n=strlen(s+1);
	for(int i=1;i<=n;++i)s[i]&=15;
	std::reverse(s+1,s+n+1);
	for(int i=1;i<=n;++i){
		t[i]+=s[i]*9;
		t[i+1]+=t[i]/10;
		t[i]%=10;
	}
	n+=!!t[n+1];
	for(int i=1;i<=n;++i)sm+=t[i];
	for(int k=1;;++k){
		t[1]+=9;sm+=9;
		for(int i=1;t[i]>9;++i)++t[i+1],t[i]-=10,sm-=9;
		n-=!t[n];
		if(k*9>=sm)return printf("%d\n",k),0;
	}
}