#include <iostream>

using namespace std;

int main()
{
    int n,k,i,j,v,s,p,o;
    p=0;
    cin>>v;
    for(;v>0;)
    {
        k=v%10;
        switch(k)
        {
            case 0: p=p; break;
            case 1: p++;break;
            case 2: p++;break;
            case 3: p+=2;break;
            case 4: p+=2;break;
            case 5: p++;break;
            case 6: p+=2;break;
            case 7: p+=2;break;
            case 8: p+=3;break;
            case 9: p+=3;break;
        }
        v=v/10;
    }
    cout<<p;
    return 0;
}