Super-Duper-ATM#8575

Super-Duper-ATM

1 second
64 megabytes
Very easy

Banknotes in circulation come in denominations of , , , , , , , , and hryvnias. The Super-Duper-ATM has an ample supply of each denomination. Your task is to determine the minimum number of banknotes the ATM can dispense to total the amount .

Input

A single integer , where 1 \leq S \leq 12345.

Output

A single integer representing the minimum number of banknotes needed to dispense the specified amount.

Examples

Example 1

Loading
Loading

Note

For example, the amount can be dispensed using 500+500+500+500+10+5+2+1, totaling eight banknotes. It is not possible to dispense the amount with fewer banknotes using the available denominations.