996A. Hit the Lottery
dp, greedy, 800, https://codeforces.com/problemset/problem/996/A
Allen has a LOT of money. He has 𝑛n dollars in the bank. For security reasons, he wants to withdraw it in cash (we will not disclose the reasons here). The denominations for dollar bills are 1, 5, 10, 20, 100. What is the minimum number of bills Allen could receive after withdrawing his entire balance?
Input
The first and only line of input contains a single integer
Output
Output the minimum number of bills that Allen could receive.
Examples
Input
125Output
3Input
43Output
5Input
1000000000Output
10000000Note
In the first sample case, Allen can withdraw this with a 100100 dollar bill, a 2020 dollar bill, and a 55 dollar bill. There is no way for Allen to receive 125125 dollars in one or two bills.
In the second sample case, Allen can withdraw two 2020 dollar bills and three 11 dollar bills.
In the third sample case, Allen can withdraw 100000000100000000 (ten million!) 100100 dollar bills.
n = int(input())
denominations = [100, 20, 10, 5, 1]
cnt = 0
for i in denominations:
cnt += n // i
n %= i
print(cnt)