#include <bits/stdc++.h>

using namespace std;

int main()
{
    string a;
    int br = 0;
    cin >> a;
    for(int i = 0 ; i < a.length() ; i++){
        if(a[i] == '1' || a[i] == '2' || a[i] == '5') br++;
        else if(a[i] == '3' || a[i] == '4' || a[i] == '6' || a[i] == '7') br += 2;
        else if(a[i] == '0') br += 0;
        else br += 3;
    }
    cout << br;
    return 0;
}