#include <iostream>

using namespace std;

int main () {
    long long int v;  cin >> v;

    int count = 0;
    while (v != 0) {
        if (v%10 != 0) {
            switch (v%10) {
                case 1: count ++; break;
                case 2: count ++; break;
                case 3: count += 2; break;
                case 4: count += 2; break;
                case 5: count ++; break;
                case 6: count += 2; break;
                case 7: count += 2; break;
                case 8: count += 3; break;
                case 9: count += 3; break;
            }
        }
        v /= 10;
    }

    cout << count;

    return 0;
}