#P2347. Counting Distinct Weights

    ID: 15620 Type: Default 1000ms 256MiB

Counting Distinct Weights

Counting Distinct Weights

We are given an unlimited number of weights with denominations \(1\mathrm{g}\), \(2\mathrm{g}\), \(3\mathrm{g}\), \(5\mathrm{g}\), \(10\mathrm{g}\) and \(20\mathrm{g}\). Using these weights, one can form various total weights by summing a selection of them. However, the total weight used must not exceed \(T\) grams (with \(0 \le T \le 1000\)).

Since a \(1\mathrm{g}\) weight is available, every positive integer weight from \(1\) to \(T\) is achievable. Therefore, the number of distinct positive weights that can be represented is exactly \(T\) (and \(0\) if \(T=0\)).

Your task is to read an integer \(T\) from input and output the number of distinct weights (greater than 0) that can be measured. Note that if \(T = 0\), you should output 0.

inputFormat

The input consists of a single integer \(T\) (\(0 \le T \le 1000\)), representing the maximum total weight in grams you can use.

outputFormat

Output a single integer representing the number of distinct positive weights that can be measured using the available weights such that the total weight does not exceed \(T\) grams.

sample

10
10