#include<set>
#include<map>
#include<deque>
#include<queue>
#include<stack>
#include<cmath>
#include<ctime>
#include<bitset>
#include<string>
#include<vector>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<climits>
#include<complex>
#include<iostream>
#include<algorithm>
#define ll long long
using namespace std;

const int maxn = 610000;

int a[maxn],n,k;
int sum;
void mul()
{
	for(int i=0;i<n;i++) a[i]*=9;
	for(int i=0;i<n;i++) if(a[i]>9)
	{
		a[i+1]+=a[i]/10;
		a[i]%=10;
	}
	while(a[n]) n++;
	for(int i=0;i<n;i++) sum+=a[i];
}
void add()
{
	a[0]+=9; sum+=9;
	int nowi=0;
	while(a[nowi]>9)
	{
		sum++; a[nowi+1]++;
		sum-=10; a[nowi++]-=10;
	}
	if(a[n]) n++;
}

int main()
{
	char c;
	while((c=getchar())>='0'&&c<='9') a[n++]=c-'0';
	for(int i=0;i<n-i-1;i++) swap(a[i],a[n-i-1]);
	mul();
	for(int k=1;k<=n;k++)
	{
		add();
		if(sum<=9*k) return printf("%d\n",k),0;
	}
	
	return 0;
}
