#include <bits/stdc++.h>

using namespace std;

const int maxN = 5e5+10;
int N,ans,A[maxN],B[maxN];
string S;

bool check(int x)
{
    B[1] = A[1]+x*9; B[N+1] = 0;
    for (int i=1; i <= N; i++)
    {
        B[i+1] = A[i+1] + B[i]/10;
        B[i] %= 10;
    }
    while (B[N+1]) N++;
    int sum = 0;
    for (int i=1; i <= N; i++) sum += B[i];
    return sum <= 9*x;
}

int main()
{
    cin >> S; N = S.size();
    for (int i=1; i <= N; i++) A[i] = S[i-1]-'0';
    reverse(A+1,A+N+1);
    int tmp = 0;
    for (int i=1; i <= N; i++)
    {
        A[i] = A[i]*9 + tmp; tmp = A[i]/10;
        A[i] %= 10;
    }
    while (tmp) A[++N] = tmp%10, tmp /= 10;
    int l = 0, r = N;
    while (l <= r)
    {
        int mid = (l+r)/2;
        if (check(mid)) ans = mid, r = mid-1;
        else l = mid+1;
    }
    cout << ans;
}
