An array of N 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 N. The second line contains N integers. Each integer has an absolute value not exceeding 100.
Output the calculated sum.
Example 1