#include <stdio.h>
main(){
    int V,bn5,bn2,bn1,bn;
    printf("Unesi sumu:");
    scanf("%d",&V);
    while(V!=0){
        if(V/5>0){
            while(bn5>=10){
                bn5=V/5;
                if(bn5>=10) bn5=bn5/10;
            }
           V=V%5;
        }
        else bn5=0;
        if(V/2>0){
            while(bn2>=10){
                bn2=V/2;
                if(bn2>=10) bn2=bn2/10;
            }
            V=V%2;
        }
        else bn2=0;
        if(V/1>0){
            while(bn1>=10){
                bn1=V/1;
                if(bn1>=10) bn1=bn1/10;
            }
            V=V%1;
        }
        else bn1=0;
    }
bn=bn5+bn2+bn1;
printf("Potreban broj novcanica je %d",bn);  
}