#GD0000003. Rút tiền tối thiểu (Hit the Lottery)
Rút tiền tối thiểu (Hit the Lottery)
Hit the Lottery
Source: Codeforces
Version: Phuoc Hung OJ Extended
Problem Statement
Represent a positive amount using unlimited banknotes of denominations . Find the minimum number of banknotes.
Input
One line contains .
Output
Print the minimum number of banknotes.
Subtasks
General constraints:
-
.
-
Subtask 1 (20 points):
-
Subtask 2 (30 points):
-
Subtask 3 (50 points): No additional constraints.
Examples
Input
125
Output
3
Explanation
, so three banknotes are sufficient, and one or two banknotes cannot total .