#include "bits/stdc++.h"
using namespace std;
const int N = 5e5 + 5;
char str[N];
int n;
int sum;
void addnine(){
    int carry = 9;
    for(int i = 0 ; carry ; ++i){
        sum -= str[i];
        carry += str[i];
        str[i] = carry % 10;
        carry /= 10;
        sum += str[i];
    }
}
void multnine(){
    int carry = 0;
    for(int i = 0 ; i < n || carry; ++i){
        carry += 9 * str[i];
        str[i] = carry % 10;
        carry /= 10;
        sum += str[i];
    }
}
int main(){
    scanf("%s" , str);
    n = strlen(str);
    reverse(str , str + n);
    sum = 0;
    for(int i = 0 ; i < n ; ++i){
        str[i] -= '0';
    }
    for(int i = n ; i < N ; ++i){
        str[i] = 0;
    }
    multnine();
    for(int k = 1 ; k <= n ; ++k){
        addnine();
        if(sum <= k * 9){
            printf("%d\n" , k);
            return 0;
        }
    }
}