#include<bits/stdc++.h>
using namespace std;
#define MAXN	500005
template <typename T> void read(T &x) {
	x = 0; int f = 1;
	char c = getchar();
	for (; !isdigit(c); c = getchar()) if (c == '-') f = -f;
	for (; isdigit(c); c = getchar()) x = x * 10 + c - '0';
	x *= f;
}
char s[MAXN];
int n, a[MAXN];
int func(int x) {
	int ans = 0;
	while (x) {
		ans += x % 10;
		x /= 10;
	}
	return ans;
}
bool check(int value) {
	int ans = 0, now = value * 9;
	for (int i = n; i >= 1; i--) {
		now += a[i] * 9;
		ans += now % 10;
		now /= 10;
	}
	return ans + func(now) <= value * 9;
}
int main() {
	scanf("%s", s + 1);
	n = strlen(s + 1);
	for (int i = n; i >= 1; i--)
		a[i] = s[i] - '0';
	int l = 1, r = n;
	while (l < r) {
		int mid = (l + r) / 2;
		if (check(mid)) r = mid;
		else l = mid + 1;
	}
	cout << l << endl;
	return 0;
}