The sum of the largest and the smallest#928

The sum of the largest and the smallest

1 second
128 megabytes
Very easy

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 \le 100) in the array. The second line contains integers, each of which 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