#include<bits/stdc++.h> 
#define rep(i,a,b) for(int i = a; i <= b; ++i)
using namespace std;
const int MAXN = 5e5 + 10;
string s;
int a[MAXN];
int n;
int ans, x;
int main() {
	cin >> s;
    n = s.length();
    for (int i = 0, j = n - 1; i < n; ++i, --j) {
		a[i] = s[j] - '0';
	}
    for (int i = 0, sx = 0; i < n; ++i) {
        sx += a[i] * 9;
        a[i] = sx % 10;
        sx /= 10;
        if (sx && i == n - 1) n++;
    }
    rep(i, 0, n - 1) x += a[i];
    for (ans = 1; ans <= n * 20; ++ans) {
        a[0] += 9;
        x += 9;
        for (int i = 0, sx = 0; i < n; ++i) {
            sx += a[i];
            x -= a[i];
            a[i] = sx % 10;
            x += a[i];
            sx /= 10;
            if (!sx) break;
            if (i == n - 1) ++n;
        }
        if (x <= 9 * ans) break;
    }
	cout << ans << "\n";
	return 0;
}