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

using namespace std;

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

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

    return cifre;
}

int main()
{
    long long unsigned novac;
    int cifre, brojac = 0;
    cin >> novac;
    string s, s1, s2;

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

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

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

    cout << brojac;
    return 0;
}
//6568568461234545556