#include <iostream>
using namespace std;
int main()
{ int v;
cout<<"Unesite iznos:";
cin>>v;
int novcanice[]={500000,200000,100000,500,200,100,50,20,10,5,2,1};
int n=0;
for (int i = 0; i < 12; i++)
{
    int x=novcanice[i];
    int pom=v/x;

    if (pom != 0)
    {
        n=n+pom;
        v=v-pom*x;
    }

}
cout<<"\nBroj novcanica je:"<<n;
    return 0;
}