#include <cstring>
#include <cstdio>
int a[500005];
char s[500005];
int main()
{
	scanf("%s",s);
	int n=strlen(s),sum=0,ans;
	for (int i=0;i<n;i++) a[n-i-1]=(s[i]-'0')*9;
	for (int i=0;i<n;i++)
	{
		a[i+1]+=a[i]/10;
		sum+=a[i]%=10;
	}
	sum+=a[n];
	for (ans=0;sum>ans;ans+=9)
	{
		a[0]+=9;sum+=9;
		for (int i=0;a[i]>9;a[++i]++)
		{
			a[i]-=10;
			sum-=9;
		}
	}
	printf("%d\n",ans/9);
	return 0;
}
