Problems
Sum without maximum
Sum without maximum
The array of n integers is given. Find the sum of all the array elements that do not equal the maximum.
Input
The first line contains the number n (n ≤ 100). The next line contains n integers, each of which does not exceed 100 by absolute value.
Output
Print the sum of all the array elements that are not equal to the maximum.
Input example #1
6 5 9 3 4 6 9
Output example #1
18
Input example #3
10 -71 -99 -72 -94 -97 -96 -22 -12 -26 -99
Output example #3
-676