#include <bits/stdc++.h>

#define ll long long

using namespace std;

int main() {

    ll c[10] = { 0, 1, 1, 2, 2, 1, 2, 2, 3, 3 };

    ll v;
    cin >> v;

    ll sol = 0;
    while(v > 0) {
        sol += c[v % 10];
        v /= 10;
    }

    cout << sol << endl;
    return 0;
}