#include <bits/stdc++.h>
using namespace std;
typedef long long lint;
typedef pair<int, int> pi;

int n;
char str[500005];

int t[500005];

int trial(int x){
	memset(t, 0, sizeof(t));
	x *= 9;
	t[0] = x;
	for(int i=0; i<n; i++){
		t[i] += 9 * (str[i] - '0');
	}
	for(int i=0; i<n || t[i]; i++){
		t[i+1] += t[i] / 10;
		t[i] %= 10;
		x -= t[i];
	}
	return x >= 0;
}

int main(){
	cin >> str;
	n = strlen(str);
	reverse(str, str + n);
	int s = 0, e = n;
	while(s != e){
		int m = (s+e)/2;
		if(trial(m)) e = m;
		else s = m+1;
	}
	cout << s;
}
