//isplata
#include <iostream>

using namespace std;

int main()
{
    unsigned long long x;
    int resenje = 0, v[] = {0, 1, 1, 2, 2, 1, 2, 2, 3, 3};
    cin >> x;

    while (x > 0)
    {
        resenje += v[x % 10];
        x /= 10;
    }
    cout << resenje << endl;
    return 0;
}