#include<iostream>

using namespace std;

int main(void)
{
    int brojac=0,ostatak;
    unsigned long long v;

    cin>>v;

    do{

        ostatak = v%10;

        if(ostatak == 1 || ostatak == 2 || ostatak == 5)
            brojac++;
        else
            if(ostatak == 3 || ostatak == 4 || ostatak == 6 || ostatak == 7)
            brojac+=2;
        else
            if(ostatak == 8 || ostatak == 9)
            brojac+=3;
        v/=10;
    }while(v>0);

    cout<<brojac;

    return 0;
}