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