#include <bits/stdc++.h>
using namespace std;
const int N=1000005;
int n,a[N];
char s[N];
int main(){
	scanf("%s",s);
	n=strlen(s);
	for (int i=0;i<n;i++)
		a[i]=(s[i]-'0')*9;
	reverse(a,a+n);
	for (int i=0;i<n;i++)
		a[i+1]+=a[i]/10,a[i]%=10;
	while (a[n])
		n++,a[n+1]+=a[n]/10,a[n]%=10;
	int now=0;
	for (int i=0;i<n;i++)
		now+=a[i];
	for (int i=1;;i++){
		int p=0;
		while (a[p]==9)
			p++;
		a[p]++,now+=1-p*9;
		while (p--)
			a[p]=0;
		if (now<=i)
			return printf("%d",(i+8)/9),0;
	}
	return 0;
}