#include <iostream>
using namespace std;
int main()
{
    long V, x;
    int b;
    cin >> V;
    b=0;
    while(V!=0)
    {
        x=V%10;
        if(x==1 || x==2 || x==5) b=b+1;
        if(x==3 || x==4 || x==6 || x==7) b=b+2;
        if(x==8 || x==9) b=b+3;
        V=V/10;
    }
    cout << b << endl;
    return 0;
}