Array Partition#11664

Array Partition

1 second
128 megabytes
Easy

Given an integer array of integers.

Group these integers into pairs (a_1, b_1), (a_2, b_2), \ldots, (a_n, b_n) such that the sum of min(a_i, b_i) for all is maximized.

Input

The first line contains one number n~(n \le 10^5). The second line contains integers, each no more than 10^5 by absolute value.

Output

Print the maximum possible value of the sum.

\sum_{i=1}^{n} min(a_i, b_i)

Examples

Example 1

Loading
Loading