#include<bits/stdc++.h>
using namespace std;
const int N=600005;
char s[N];
int a[N],n,sum;
void update(int x,int y){
	sum-=a[x];
	a[x]+=y;
	sum+=a[x];
	if (a[x]>=10){
		sum-=10;
		if (n==x)n++;
		a[x]-=10;
		update(x+1,1);
	}
}
int main(){
	scanf("%s",s+1);
	int n=strlen(s+1);
	for (int i=1;i<=n;i++)a[i]=s[n-i+1]-'0';
	for (int i=1;i<=n;i++)a[i]*=9;
	for (int i=1;i<=n;i++)a[i+1]+=a[i]/10,a[i]%=10;
	if (a[n+1])n++;
	sum=0;
	for (int i=1;i<=n;i++)sum+=a[i];
	for (int k=1;;k++){
		update(1,9);
		if (k*9>=sum){
			printf("%d\n",k);
			return 0;
		}
	}
}
