#include <iostream>

using namespace std;

int main()
{
    unsigned long long a;
    cin >> a;
    int b[18];
    int br = 0;
    int t = 0;
    do{
        t++;
        b[t]= a % 10;
        a = a / 10;

    } while (a!=0);

    for (int i=1; i<=t; i++){
        switch (b[i]){
        case 1:
            br++;
            break;
        case 2:
            br++;
            break;
        case 3:
            br+=2;
            break;
        case 4:
            br+=2;
            break;
        case 5:
            br++;
            break;
        case 6:
            br+=2;
            break;
        case 7:
            br+=2;
            break;
        case 8:
            br+=3;
            break;
        case 9:
            br+=3;
            break;
        }
    }
    cout << br;
    return 0;
}