#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int n;
vector<int> a;
char s[1111111];
int sum;

int main() {
	scanf("%s", s);
	n = strlen(s);
	for (int i = n - 1; i >= 0; --i)
		a.push_back(s[i] - '0');
	int p = 0;
	for (int i = 0; i < (int)a.size(); ++i) {
		a[i] = a[i] * 9 + p;
		p = a[i] / 10; a[i] %= 10;
	}
	if (p) a.push_back(p);
	for (int i = 0; i < (int)a.size(); ++i) sum += a[i];
	for (int i = 1; ; ++i) {
		for (int j = 0; j < 9; ++j) {
			++sum; ++a[0];
			for (int i = 0; ; ++i)
				if (a[i] == 10) {
					sum -= 10; a[i] = 0;
					if (i + 1 == (int)a.size()) a.push_back(0);
					++a[i + 1]; ++sum;
				} else break;
		}
		if (sum <= i * 9) {
			printf("%d", i); return 0;
		}
	}
}
