#include <iostream>
#include <string>

using namespace std;

int main()
{
    int br = 0;
    string s;
    cin >> s;

    for (int i = 0; i < s.size(); i++)
    {
        if (s[i] == '1' || s[i] == '2' || s[i] == '5')
            br++;
        else if (s[i] == '3' || s[i]== '4' || s[i] == '6' || s[i] == '7')
            br += 2;
        else if (s[i] == '8' || s[i] == '9')
            br += 3;
    }

    cout << br;


    return 0;
}