#include<bits/stdc++.h>

using namespace std;

int v[500100], h[500100];
char sir[500100];

void read ()
{
    scanf ("%s", sir + 1), v[0] = strlen (sir + 1);
    for (int i=1; i<=v[0]; i++)
        v[i] = sir[v[0] + 1 - i] - '0';
}

void mul9 ()
{
    int t = 0;
    for (int i=1; i<=v[0]; i++)
    {
        v[i] *= 9, v[i] += t;
        t = v[i] / 10, v[i] %= 10;
    }
    if (t) v[++v[0]] = t;
}

int sumAdd (int ad)
{
    for (int i=0; i<=v[0]; i++)
        h[i] = v[i];
    h[v[0] + 1] = h[v[0] + 2] = h[v[0] + 3] = 0;
    int i = 1, ans = 0;
    h[1] += ad;
    while (h[i] > 9)
        h[i + 1] += h[i] / 10, h[i] %= 10, i ++;
    if (i > h[0]) h[0] = i;
    for (int i=1; i<=h[0]; i++)
        ans += h[i];
    return ans;
}

int main ()
{
//freopen ("input", "r", stdin);
//freopen ("output", "w", stdout);

read ();
mul9 ();
int p = 1, u = v[0] + 1000, mij, ras = -1;
while (p <= u)
{
    mij = (p + u) >> 1;
    if (sumAdd (9 * mij) <= 9 * mij)
        ras = mij, u = mij - 1;
    else
        p = mij + 1;
}
printf ("%d\n", ras);
return 0;
}
