#include<iostream>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<cstdio>
using namespace std;

const int N=1000005;

int n,l,r,mid,len;
int a[N];
char s[N];

bool check(int w){
	int i,sum; len=n;
	for (i=1;i<=n;i++) a[i]=(s[i]-'0')*9;
	a[1]+=9*w;
	for (i=1;i<=n;i++){
		a[i+1]+=a[i]/10;
		a[i]=a[i]%10;
	}
	while (a[len+1]){
		len++;
		a[len+1]+=a[len]/10;
		a[len]=a[len]%10;
	}
	sum=0;
	for (i=1;i<=len;i++) sum+=a[i];
	for (i=1;i<=len;i++) a[i]=0;
	if (sum<=9*w) return 1;
	return 0;
}

int main(){
	int i;
	scanf("%s",s+1); n=strlen(s+1);
	reverse(s+1,s+1+n);
	l=1; r=n;
	while (l<r){
		mid=l+(r-l)/2;
		if (check(mid)) r=mid;
		else l=mid+1;
	}
	printf("%d\n",r);
	return 0;
}