# Cash machine

Easy

Execution time limit is 1 second

Runtime memory usage limit is 128 megabytes

In the ATM, there are sufficient banknotes with denominations of $10,20,50,100,200$, and $500$ hryvnias. Find the minimum number of banknotes needed to dispense the amount of $n$ hryvnias.

## Input

One integer $n(1≤n≤10_{6})$.

## Output

Print the minimum number of banknotes needed to dispense $n$ hryvnias. Print $−1$ if the specified amount cannot be dispensed.

## Examples

The sum of $770$ hryvnia can be dispensed as follows: $500+200+50+20$.

Input #1

Answer #1

Submissions 29K

Acceptance rate 40%