#include <bits/stdc++.h>

using namespace std;

int main()
{
    long long a;
    cin>>a;
    int br = 0, s;
    while(a!=0)
    {
        s = a%10;
        if(s==1) br++;
        if(s==2) br++;
        if(s==3) br+=2;
        if(s==4) br+=2;
        if(s==5) br++;
        if(s==6) br+=2;
        if(s==7) br+=2;
        if(s==8) br+=3;
        if(s==9) br+=3;

        a/=10;
    }

    cout<<br;


    return 0;
}