#include <stdio.h>
#include <stdlib.h>

int main()
{
    long long novac;
    int n=0;
    scanf("%lli", &novac);
    while(novac!=0){
        switch(novac%10){
        case 1:
            n+=1;
                break;
        case 2:
            n+=1;
                break;
        case 3:
            n+=2;
                break;
        case 4:
            n+=2;
                break;
        case 5:
            n+=1;
                break;
        case 6:
            n+=2;
                break;
        case 7:
            n+=2;
                break;
        case 8:
            n+=3;
                break;
        case 9:
            n+=3;
                break;
        }
    novac=novac/10;
    }
    printf("%i", n);
    return 0;
}