An array of integers is provided as input. The task is to calculate the sum of the array's elements, excluding all instances of its smallest and largest values.
The first line contains a natural number . The second line contains integers. Each integer has an absolute value not exceeding .
Output the calculated sum.
Example 1