#include <iostream>
using namespace std;
string s;
int p;
int main ()
{
    cin>>s;
    for(int i=s.length()-1;i>=0;i--)
    {
        if(s[i]=='1' or s[i]=='2' or s[i]=='5')
        {
            p++;
        }
        else if(s[i]=='3' or s[i]=='4' or s[i]=='6' or s[i]=='7')
        {
           p=p+2;
        }
        else if(s[i]=='8' or s[i]=='9')
        {
            p=p+3;
        }
    }
    cout<<p;
}