#include<bits/stdc++.h>
using namespace std;

inline int read()
{
	int x = 0, f = 1; char ch = getchar();
	for (; ch < '0' || ch > '9'; ch = getchar()) if (ch == '-') f = -1;
	for (; ch >= '0' && ch <= '9'; ch = getchar()) x = (x << 1) + (x << 3) + ch - '0';
	return x * f;
}

const int N = 1e6 + 5;
int a[N];
string s;

int main()
{
	cin >> s;
	int n = s.size();
	for (int i = 1; i <= n; ++i) a[i] = s[n - i] - '0';
	
	for (int i = 1; i <= n; ++i) a[i] *= 9;
	for (int i = 1; i <= n; ++i) a[i + 1] += a[i] / 10, a[i] %= 10;
	if (a[n + 1]) ++n;
	
	int tot = 0;
	for (int i = 1; i <= n; ++i) tot += a[i];
	for (int k = 1, i; ; ++k)
	{
		a[i = 1] += 9;
		tot += 9;
		for (; a[i] >= 10; ++i)
		{
			a[i + 1] += a[i] / 10;
			a[i] %= 10;
			tot -= 9;
		}
		if (tot <= 9 * k && tot % 9 == 0) 
			return printf("%d\n", k), 0;
	}
	
	return 0;
}
