#K67342. Calculate Total Contest Points
Calculate Total Contest Points
Calculate Total Contest Points
A participant competes in several contests, and their performance in each contest is represented by their rank. The scoring system awards points only for the top 5 ranks as follows:
- Rank 1: 10 points
- Rank 2: 7 points
- Rank 3: 5 points
- Rank 4: 3 points
- Rank 5: 1 point
Any rank greater than 5 earns 0 points. Given the number of contests and the rank in each contest, your task is to compute the total points the participant has earned.
Note: The input will be provided via standard input (stdin) and the result should be printed to standard output (stdout).
inputFormat
The first line contains an integer n representing the number of contests. The second line contains n space-separated integers, each representing the rank achieved in a contest.
outputFormat
Output a single integer representing the total points earned across all contests.## sample
5
1 2 3 4 5
26