import numpy as np



N = int(eval(input()))

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



if(len(L) != 2*N):

    print("wrong number !")

    exit()



x=0

L.sort(reverse=True)

for i in range(N):

    x = x + min(L[2*i:2*(i+1)])



print(x)

N = int(eval(input()))

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



if(len(L) != 2*N):

    print("wrong number !")

    exit()



x=0

L.sort(reverse=True)

for i in range(N):

    x = x + min(L[2*i:2*(i+1)])



print(x)

import numpy as np

N = int(eval(input()))
L = list(map(int, input().split()))
if len(L) != 2 * N:
    print("wrong number !")
    exit()
x = 0
L.sort(reverse=True)
for i in range(N):
    x = x + min(L[2 * i : 2 * (i + 1)])
print(x)

N = int(eval(input()))
L = list(map(int, input().split()))
if len(L) != 2 * N:
    print("wrong number !")
    exit()
x = 0
L.sort(reverse=True)
for i in range(N):
    x = x + min(L[2 * i : 2 * (i + 1)])
print(x)

-import numpy as np -