n= int(input())
vals= input()
a= list(map(int,vals.split()))
count=0
a.sort()
if n%2==0:
    for i in range(0,int(n/2)):
        count=count+a[2*i+1]
elif n%2==1:
    for j in range(1,int((n+1)/2)):
        count=count+a[2*j]
print(count)
