#include <iostream>
#include <stdio.h>

using namespace std;

int main()
{
    long long int n;
    int z=0,c;
    scanf("%lld",&n);
    while(n>0)
    {
        c=n%10;
        if(c==1)z=z+1;
        if(c==2)z=z+1;
        if(c==3)z=z+2;
        if(c==4)z=z+2;
        if(c==5)z=z+1;
        if(c==6)z=z+2;
        if(c==7)z=z+2;
        if(c==8)z=z+3;
        if(c==9)z=z+3;
        if(c==0)z=z+0;
        n=n/10;
    }
    printf("%d",z);
}