#abc204b. [abc204_b]Nuts
[abc204_b]Nuts
Problem Statement
There are trees. The -th tree bears nuts.
Chipmunk will harvest nuts from the trees in the following manner:
- From a tree with or fewer nuts, she does not take nuts.
- From a tree with more than nuts, she takes all but nuts.
Find the total number of nuts Chipmunk will take from the trees.
Constraints
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
Output
Print the answer.
Sample Input 1
3
6 17 28
Sample Output 1
25
From the three trees, Chipmunk will take , , and nuts, for a total of nuts.
Sample Input 2
4
8 9 10 11
Sample Output 2
1