eolymp
bolt
Try our new interface for solving problems
Problems

Array Partition

Array Partition

Time limit 1 second
Memory limit 128 MiB

Given an integer array of 2n integers.

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

Input data

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

Output data

Print the maximum possible value of the sum.

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

Examples

Input example #1
2
4 1 3 2
Output example #1
4