~/algor $ cat problems/hakamlar-bahosi
Judges' scores
Easy
1000 ms
64 MB
21%
An athlete's performance was scored by $n$ judges. To be fair, one highest and one lowest score are discarded (even if several scores are equal to the highest, only one of them is discarded). Find the sum of the remaining scores.
Input
The first line contains a positive integer $n$.
The second line contains $n$ integers — the scores.
Output
One integer — the sum.
Note
$3 \le n \le 100$
each score is from $0$ to $100$
Examples
Input #1
5 7 9 6 10 8
Output #1
24
Input #2
3 5 5 5
Output #2
5