N = int(eval(input()))

A = list(map(int,input().split()))

A.sort(reverse= True)

ans = 0

for i in range(N*2):

    if i%2 == 1:

        ans += A[i]

print(ans)
import sys

import math

import itertools

import bisect

from copy import copy

from collections import deque,Counter

from decimal import Decimal

def s(): return eval(input())

def i(): return int(eval(input()))

def S(): return input().split()

def I(): return list(map(int,input().split()))

def L(): return list(input().split())

def l(): return list(map(int,input().split()))

def lcm(a,b): return a*b//math.gcd(a,b)

fact = math.factorial

sys.setrecursionlimit(10**9)

INF = 10**9

mod = 10**9+7



N = i()

a = l()

a.sort(reverse=True)

ans = 0

for i in range(2*N):

    if i%2 == 1:

        ans += a[i]

print(ans)
N = int(eval(input()))
A = list(map(int, input().split()))
A.sort(reverse=True)
ans = 0
for i in range(N * 2):
    if i % 2 == 1:
        ans += A[i]
print(ans)

import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque, Counter
from decimal import Decimal


def s():
    return eval(input())


def i():
    return int(eval(input()))


def S():
    return input().split()


def I():
    return list(map(int, input().split()))


def L():
    return list(input().split())


def l():
    return list(map(int, input().split()))


def lcm(a, b):
    return a * b // math.gcd(a, b)


fact = math.factorial
sys.setrecursionlimit(10**9)
INF = 10**9
mod = 10**9 + 7
N = i()
a = l()
a.sort(reverse=True)
ans = 0
for i in range(2 * N):
    if i % 2 == 1:
        ans += a[i]
print(ans)

-N = int(eval(input())) -A = list(map(int, input().split())) -A.sort(reverse=True) +import sys +import math +import itertools +import bisect +from copy import copy +from collections import deque, Counter +from decimal import Decimal + + +def s(): +    return eval(input()) + + +def i(): +    return int(eval(input())) + + +def S(): +    return input().split() + + +def I(): +    return list(map(int, input().split())) + + +def L(): +    return list(input().split()) + + +def l(): +    return list(map(int, input().split())) + + +def lcm(a, b): +    return a * b // math.gcd(a, b) + + +fact = math.factorial +sys.setrecursionlimit(10**9) +INF = 10**9 +mod = 10**9 + 7 +N = i() +a = l() +a.sort(reverse=True) -for i in range(N * 2): +for i in range(2 * N): -        ans += A[i] +        ans += a[i]