#include <iostream>
#include <stdio.h>
#include <algorithm>

using namespace std;

string s;
int n;
int g;
long int tal;

int main()
{
    cin>>s;
    n=s.length();
    for(int i=0; i<n;i++){
        g=s[i]-48;
        if(g==1||g==2||g==5){
            tal++;
        }else if(g==3||g==4||g==6||g==7){
            tal=tal+2;
        }else if(g==8||g==9){
            tal=tal+3;
        }
    }
    cout<<tal;
    return 0;
}