eolymp
bolt
Try our new interface for solving problems
Problems

Sum without maximum

Sum without maximum

The array of $n$ integers is given. Find the sum of all array elements that are not equal to the maximum. \InputFile The first line contains the number $n~(n \le 100)$. The next line contains $n$ integers, each of which does not exceed $100$ in absolute value. \OutputFile Print the sum of all the array elements that are not equal to the maximum.
Time limit 1 second
Memory limit 128 MiB
Input example #1
6
5 9 3 4 6 9
Output example #1
18