e-olymp
favorite We need a little bit of your help to keep things running, click on this banner to learn more
Competitions

Week 9: January 11 - 17. Pointers. References

Sum without maximum

Given array of n integers. Find the sum of all array elements, not equal to maximal.

Input

First line contains number n (n100). Next line contains n integers, each of them does not exceed 100 by absolute value.

Output

Print the sum of all array elements, not equal to maximal.

Time limit 1 second
Memory limit 128 MiB
Input example #1
6
5 9 3 4 6 9
Output example #1
18