Question
Prize Badges for Contest Ranks
A school gives prize badges to
Find the minimum total number of badges needed.
Input
The first line contains an integer KaTeX can only parse string typed expression.
The second line contains KaTeX can only parse string typed expression integers — the performance scores.
Output
Print a single integer — the minimum total number of badges.
Example
Example 1:
Input
Example 2:
Input
Input
3
1 2 2Output4Example 2:
Input
5
1 3 4 5 2Output11