The sum of the largest and the smallest#120

The sum of the largest and the smallest

1 second
128 megabytes
Very easy (≈850)

The array of integers is given. Find the sum of the smallest and the largest elements of the array.

Input

The first line contains the number of elements n~(n \le 100) in the array. The second line contains elements of the array. Each number in the array does not exceed in absolute value.

Output

Print the sum of the smallest and the largest elements of the array.

Examples

Example 1

Loading
Loading