#include<algorithm>
#include<cstring>
#include<cctype>
#include<cstdio>
#define rep(i,x,y) for(int i=x; i<=y; ++i)
#define mid (l+r>>1)

using namespace std;
const int N=500005;
char s[N];
int n,a[N],c[N];

bool check(int x)
{
	int lim=0;
	c[n+1]=0;
	rep(i,1,n) c[i]=a[i];
	c[1]+=9*x;
	rep(i,1,n) c[i+1]+=c[i]/10,c[i]%=10;
	rep(i,1,n+1) lim+=c[i];
	return lim<=9*x;
}

int main()
{
	scanf("%s",s+1),n=strlen(s+1);
	rep(i,1,n) a[i]=s[n-i+1]-'0';
	rep(i,1,n) a[i]=a[i]*9;
	rep(i,1,n) a[i+1]+=a[i]/10,a[i]%=10;
	if(a[n+1]) ++n;
	int l=1,r=n*20;
	while(l<=r) check(mid)?r=mid-1:l=mid+1;
	printf("%d\n",r+1);
	return 0;
}