#include <bits/stdc++.h>

using namespace std;

int main()
{
    long long v,p,r=0;
    cin>>v;
    long long c=v;
    while(v)
    {
        switch(v%10)
        {
            case 0: break;
            case 1: r++; break;
            case 2: r++; break;
            case 3: r=r+2; break;
            case 4: r=r+2; break;
            case 5: r++; break;
            case 6: r=r+2; break;
            case 7: r=r+2; break;
            case 8: r=r+3; break;
            case 9: r=r+3; break;

        }
        v=v/10;
    }
    cout<<r;



    return 0;
}