#include <iostream>
#include <math.h>
#include <bits/stdc++.h>

using namespace std;

int brojCifri(long long p)
{
    int cifre = 0;

    while(p != 0)
    {
        p = p / 10;
        cifre++;
    }

    return cifre;
}

int main()
{
    unsigned long long novac, x;
    int cifre, brojac = 0;
    cin >> novac;

    do
    {
        cifre = brojCifri(novac);
        if(novac >= 5 * (pow(10.0, cifre - 1)))
        {
            cout << novac;
            brojac++;
            novac = novac - 5 * (pow(10.0, cifre - 1));
            x = 5 * (pow(10.0, cifre - 1));
            cout << " - " << x << " = " << novac << " br: " << brojac<<  endl <<(long long)pow(10.0, cifre - 1) << " = 10 na " << cifre - 1 << endl;
            continue;
        }

        if(novac >= 2 * (pow(10.0, cifre - 1)))
        {
            cout << novac;
            brojac++;
            novac = novac - 2 * (pow(10.0, cifre - 1));
            x = 2 * (pow(10.0, cifre - 1));
            cout << " - " << x << " = " << novac << " br: " << brojac << " " <<  endl << (long long)pow(10.0, cifre - 1) << " = 10 na " << cifre - 1<<endl;
            continue;
        }

        if(novac >= 1 * (pow(10.0, cifre - 1)))
        {
            cout << novac;
            brojac++;
            novac = novac - 1 * (pow(10.0, cifre - 1));
            x = pow(10.0, cifre - 1);
            cout << " - " << x << " = " << novac << " br: " << brojac << endl<< (long long)pow(10.0, cifre - 1)<< " = 10 na " << cifre - 1<< endl;
            continue;
        }
    }
    while(novac > 0);

    cout << brojac;
    return 0;
}