#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <bits/stdc++.h>
/*#pragma GCC optimize("Ofast","unroll-loops","omit-frame-pointer","inline") //Optimization flags
#pragma GCC option("arch=native","tune=native","no-zero-upper") //Enable AVX
#pragma GCC target("avx2")  //Enable AVX*/

using namespace std;

using ll = long long;

#define mp make_pair

const int p = 998244353;


int mul(int a, int b) {
    return (1LL * a * b) % p;
}

int add(int a, int b) {
    int s = (a+b);
    if (s>=p) s-=p;
    return s;
}

int sub(int a, int b) {
    int s = (a+p-b);
    if (s>=p) s-=p;
    return s;
}

int po(int a, int deg)
{
    if (deg==0) return 1;
    if (deg%2==1) return mul(a, po(a, deg-1));
    int t = po(a, deg/2);
    return mul(t, t);
}

int inv(int n)
{
    return po(n, p-2);
}

/*struct DSU {
    vector<int> sz;
    vector<int> parent;

    void make_set(int v) {
        parent[v] = v;
        sz[v] = 1;
    }

    int find_set(int v) {
        if (v == parent[v])
            return v;
        return parent[v] = find_set(parent[v]);
    }

    void union_sets(int a, int b) {
        a = find_set(a);
        b = find_set(b);
        if (a != b) {
            if (sz[a] < sz[b])
                swap(a, b);
            parent[b] = a;
            sz[a] += sz[b];
        }
    }

    DSU(int n) {
        sz.resize(n);
        parent.resize(n);
        for (int i = 0; i < n; i++) make_set(i);
    }
};*/

/*const int N = 1000000;

vector<int> facs(N), invfacs(N);

void init()
{
    facs[0] = 1;
    for (int i = 1; i<N; i++) facs[i] = mul(facs[i-1], i);
    invfacs[N-1] = inv(facs[N-1]);
    for (int i = N-2; i>=0; i--) invfacs[i] = mul(invfacs[i+1], i+1);
}

int C(int n, int k)
{
    return mul(facs[n], mul(invfacs[k], invfacs[n-k]));
}*/

const int N = 500005;

vector<int> digs;

int st;

bool check(int x)
{
    x = st + 10*x;
    //cout<<"checking: "<<x<<endl;

    int x1 = x;

    vector<int> d;
    while (x)
    {
        d.push_back(x%10);
        x/=10;
    }
    int carry = 0;
    for (int i = 0; i<N; i++)
    {
        int value = carry + digs[i];
        if (i<d.size()) value+=d[i];
        digs[i] = value%10;
        carry = value/10;
    }

    /*for (int i = 0; i<20; i++) cout<<digs[i]<<' ';
    cout<<endl;*/

    int res = 0;
    for (auto it: digs) res+=it;

    bool answer = (res<=x1);
    //cout<<res<<' '<<x1<<' '<<answer<<endl;

    carry = 0;
    for (int i = 0; i<N; i++)
    {
        int value = carry + digs[i];
        if (i<d.size()) value-=d[i];
        digs[i] = (value+20)%10;
        carry = ((value + 20)/10) - 2;
    }

    /*for (int i = 0; i<20; i++) cout<<digs[i]<<' ';
    cout<<endl;*/

    return answer;
}

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(nullptr);

    string s;
    cin>>s;

    for (int i = s.size()-1; i>=0; i--) digs.push_back(s[i]-'0');

    st = digs[0];

    /*for (auto it: digs) cout<<it<<' ';
    cout<<endl;*/

    int carry = 0;
    int n = s.size();
    for (int i = 0; i<n; i++)
    {
        int value = 9*digs[i] + carry;
        digs[i] = value%10;
        carry = value/10;
    }
    if (carry>0) digs.push_back(carry);

    digs.resize(N);


    /*for (int i = 0; i<20; i++) cout<<digs[i]<<' ';
    cout<<endl;*/

    int L = 0;
    int R = 100000000;
    if (check(L))
    {
        cout<<1; return 0;
    }
    while (R-L>1)
    {
        int mid = (L+R)/2;
        if (check(mid)) R = mid;
        else L = mid;
    }
    //cout<<L<<' '<<R<<endl;
    cout<<(st + 10*R + 8)/9;



}



Measured memory_bytes: 3352