#include <string>
#include <iostream>
using namespace std;
string V;
int k,br;
int main()
{
    cin>>V;
    br=0;
    k=V.size();
    for(int i=0;i<k;i++)
    {
    if (V[i]=='1' or V[i]=='2' or V[i]=='5'){
    br++;}
    else if (V[i]=='3' or V[i]=='4' or V[i]=='6' or V[i]=='7'){
    br=br+2;}
    else if (V[i]=='8' or V[i]=='9'){
        br+=3;
    }
    }
    cout<<br;
    return 0;
}