#include <iostream>
#include <string>
using namespace std;

int main()
{
    int br=0;
    string str;
    cin>>str;
    int n=str.length();
    for(int i=0;i<n;i++)
    {
        if(str[i]=='1')
            br++;
        if(str[i]=='2')
            br++;
        if(str[i]=='3')
            br+=2;
        if(str[i]=='4')
            br+=2;
        if(str[i]=='5')
            br++;
        if(str[i]=='6')
            br+=2;
        if(str[i]=='7')
            br+=2;
        if(str[i]=='8')
            br+=3;
        if(str[i]=='9')
            br+=3;
    }
    cout<<br;

    return 0;
}