#include <iostream>
#include <string>

using namespace std;

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

}