AT_jag2018summer_day2_b Coins
Description
[problemUrl]: https://atcoder.jp/contests/jag2018summer-day2/tasks/jag2018summer_day2_b
There are $ 1 $-, $ 5 $-, $ 10 $-, $ 50 $-, $ 100 $-, $ 500 $- yen coins, and you have an infinite number of coins of each type.
For a given positive integer $ x $, let $ f(x) $ be the smallest number of coins you have to use to pay exactly $ x $ yen. For example, $ f(2018)=\ 9 $ because $ 2018\ =\ 1\ +\ 1\ +\ 1\ +\ 5\ +\ 10\ +\ 500\ +\ 500\ +\ 500\ +\ 500 $.
You are given a positive integer $ N $. Count the number of positive integers $ x $ such that $ f(x)\ =\ N $.
Input Format
Input is given from Standard Input in the following format:
> $ N $
Output Format
Print the number of positive integers $ x $ such that $ f(x)\ =\ N $.
Explanation/Hint
### Constraints
- $ 1\ \leq\ N\ \leq\ 10^{18} $
### Sample Explanation 1
The value of $ x $ is $ 1,\ 5,\ 10,\ 50,\ 100, $ or $ 500 $.
### Sample Explanation 2
The value of $ x $ is $ 2,\ 6,\ 11,\ 15,\ 20,\ 51,\ 55,\ 60,\ 101,\ 105,\ 110,\ 150,\ 200,\ 501,\ 505,\ 510,\ 550,\ 600, $ or $ 1000 $.