#include <iostream>

using namespace std;

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