Except for the smallest and the largest#121

Except for the smallest and the largest

1 second
64 megabytes
Very easy (≈850)

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.

Input

The first line contains a natural number N. The second line contains N integers. Each integer has an absolute value not exceeding 100.

Output

Output the calculated sum.

Examples

Example 1

Loading
Loading