#include <studio.h>
#include <stdlib.h>
#include <math.h>

int main()
{
 int i,b,V,u;
u=0;
printf("unesite V");
scanf("%d",&V);
while (V>0)
{
b=V%10;
V=V/10;
switch(b)
{
    case 0:
    i=0;
    break;
     case 1:
    i=1;
    break;
     case 2:
    i=1;
    break;
     case 3:
    i=2;
    break;
     case 4:
    i=2;
    break;
     case 5:
    i=1;
    break;
     case 6:
    i=2;
    break;
     case 7:
    i=2;
    break;
     case 8:
    i=3;
    break;
     case 9:
    i=3;
    break;
}
u=u+i;
}
printf("%d",u);
return 0;
}