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