#include<iostream>
#include<cmath>
using namespace std;
int main()
{
    int d,k,t,a,v,n,m,p;
    p=0;
    m=0;
    cin>>v;
    t=v;
    while(t!=0)
    {
        m++;
        t/=10;
    }
    for (n=1;n<=m;n++)
    {
        a=v%10;
        v/=10;
        switch(a)
        {
            case 1:
            p+=1;
            break;
             case 2:
            p+=1;
            break;
             case 3:
            p+=2;
            break;
             case 4:
            p+=2;
            break;
             case 5:
            p+=1;
            break;
             case 6:
            p+=2;
            break;
             case 7:
            p+=2;
            break;
             case 8:
            p+=3;
            break;
             case 9:
            p+=3;
            break;
        }
    }
    cout<<p;
}