#include <bits/stdc++.h>
using namespace std;
int br;
string s;
int main(){
    getline(cin,s);
    for(int i=0;i<=s.size()-1; i++)
    {
    if(s[i]=='1' or s[i]=='2' or s[i]=='5')br++;
    else
    if(s[i]=='3' or s[i]=='4' or s[i]=='6' or s[i]=='7')br+=2;
    else 
    if(s[i]=='8' or s[i]=='9')br+=3;
    }
    cout<<br<<endl;



   return 0;
}