#include <iostream>
using namespace std;
int main()
{
    long long int x;
    cin>>x;
    int rez=0;
    int d;
    while(x>0)
    {
        d=x%10;
        switch(d)
        {
            case 0:break;
            case 1:rez++;break;
            case 2:rez++;break;
            case 3:rez+=2;break;
            case 4:rez+=2;break;
            case 5:rez++;break;
            case 6:rez+=2;break;
            case 7:rez+=2;break;
            case 8:rez+=3;break;
            case 9:rez+=3;break;
        }
        x/=10;
    }
    cout<<rez;
}