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

const int N = 5e5 + 100;

char s[N];
int a[N], cnt;
int n;

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