Snuke is having a barbeque party.
At the party, he will make N servings of Skewer Meal.
Example of a serving of Skewer Meal
He has a stock of 2N skewers, all of which will be used in Skewer Meal. The length of the i-th skewer is L_i.
Also, he has an infinite supply of ingredients.
To make a serving of Skewer Meal, he picks 2 skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be x, then the serving can hold the maximum of x ingredients.
What is the maximum total number of ingredients that his N servings of Skewer Meal can hold, if he uses the skewers optimally?

-----Constraints-----
 - 1≦N≦100
 - 1≦L_i≦100
 - For each i, L_i is an integer.

-----Input-----
The input is given from Standard Input in the following format:
N
L_1 L_2 ... L_{2N}

-----Output-----
Print the maximum total number of ingredients that Snuke's N servings of Skewer Meal can hold.

-----Sample Input-----
2
1 3 1 2

-----Sample Output-----
3

If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold 1 and 2 ingredients, for the total of 3.

Difficulty: interview

Starter code:

Solutions:
N=int(input())
A=list(map(int,input().split()))
A.sort()
sm=0
for i in range(0,2*N,2):
  sm+=A[i]
print(sm)


n = int(input())
l = [int(s) for s in input().split()]
l.sort()
ans = 0
for i in range(0, n * 2, 2):
    ans += min(l[i], l[i + 1])

print(ans)

N = int(input())
L = list(map(int, input().split()))
L.sort()
ans = 0
for i in range(N):
    ans += min(L[2*i], L[2*i+1])
print(ans)

import sys

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

L.sort(reverse=True)

a = L[1::2]

s = 0

for x in a:
    s += x

print(s)

input()
a = list(map(int, input().split()))
a.sort()
ans = sum([min(a[2 * i : 2 * i + 2]) for i in range(len(a) // 2)])
print(ans)

n = int(input()); a = list(map(int, input().split()))
a.sort(); b = 0
for i in range(n): b += a[2*i]
print(b)

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

print(sum(L[::2]))

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

L.sort()
amt = 0
while (len(L) > 0):
	(L1, L2) = L[0:2]
	amt += min([L1, L2])
	del L[0:2]

print(amt)


import sys

input = sys.stdin.readline


def main():
    N = int(input())
    L = list(map(int, input().split()))

    L.sort()
    ans = sum(L[i] for i in range(0, 2 * N, 2))

    print(ans)


def __starting_point():
    main()

__starting_point()

n = int(input())
l = [int(i) for i in input().split()]
l.sort()
ans = 0
for i in range(0,2*n,2):
    ans += l[i]
print(ans)

N = int(input())
L = map(int, input().split())
def skewer(input):
  x = sorted(input, reverse = True)
  result = 0
  for i in range(0,len(x)):
    if i%2 ==1:
      result = result + x[i]
  return result 
print(skewer(L))

n=int(input())
L=list(map(int,input().split()))
L.sort()
s=sum(L[::2])
print(s)

x = input()
s = sorted(list(map(int, input().split())))
print(sum(s[::2]))

import sys
pin=sys.stdin.readline
def main():
  N=int(pin())
  L=list(map(int,pin().split()))
  L.sort()
  ans=0
  for i in range(0,2*N,2):
    ans+=L[i]
  print(ans)
  return

def __starting_point():
  main()

__starting_point()

print((sum(sorted(map(int,open(0).read().split()[1:]))[::2])))


n=int(input())
ans=int(0)

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

A.sort()
for i in range(n):
	ans+=A[i*2]
print(ans)



N = int(input())
L = sorted(map(int, input().split()))

ans = 0
for i in range(N):
    ans += L[i * 2]

print(ans)


n = int(input())
array = list(map(int, input().split()))
array.sort()

ans = 0
for i in range(n * 2):
    if i % 2 == 0:
        ans += array[i]

print(ans)


n = int(input())
l = list(map(int,input().split()))
l.sort()
print(sum(l[::2]))

n=int(input())
l=sorted(list(map(int,input().split())))
sum=0
for i in range(2*n):
    if i%2==0:
        sum+=l[i]
print(sum)

N=int(input())
L=sorted(list(map(int,input().split())),reverse=True)
ans=0
for i in range(1,len(L),2):
  ans+=min(L[i],L[i-1])
print(ans)


N = int(input())
L = list(map(int,input().split()))
L.sort()
ans = 0
for i in range(0,2*N,2):
  ans += L[i]
print(ans)

n=int(input())
a=list(map(int,input().split()))
a.sort()
sum=0
for i in range(0,len(a),2):
  sum+=a[i]
print(sum)

N = int(input())
L = [int(i) for i in input().split()]
L.sort(reverse=True)
S = 0
for i in range(N):
    S += L[2*i+1]
print(S)


n = int(input())
n *= 2
lst = input().split(" ")
for m in range(0,n):
    lst[m] = eval(lst[m])
for i in range(0,n):
    for j in range(0,n-i-1):
        if lst[j] < lst[j+1]:
            temp = lst[j]
            lst[j] = lst[j+1]
            lst[j+1] = temp

result = 0
for k in range(0,n):
    if k % 2 == 1:
        result += lst[k]
print(result)

n=int(input())
print(sum(sorted(map(int,input().split()))[::2]))

n=int(input())
a=list(map(int,input().split()))
a.sort()
sum=0
for i in range(0,len(a),2):
    sum+=min(a[i],a[i+1])

print(sum)    
    
    

               
              
        
               
    
        
    
            

        
                
        
    


n = int(input())
l = list(map(int, input().split()))
l.sort(reverse=1)
res = 0
for i in range(2*n):
    if i%2 != 0: continue
    res += min(l[i],l[i+1])
print(res)

N = int(input())
L = list(map(int,input().split()))
print(sum(sorted(L)[0::2]))

n = int(input())
l = sorted(list(map(int, input().split())))

ans = 0

for i in range(2*n):
  if i%2 == 0:
    ans += l[i]
print(ans)

N=input().rstrip()
Ls=list(map(int, input().split()))
Ls.sort(reverse=True)


# print(Ls)
totalBarLength=0
for i in range(0,len(Ls),2):
    barLength=Ls[i+1]
    totalBarLength += barLength
print(totalBarLength)

n = int(input())
l = list(map(int,input().split()))
answer = 0
l = sorted(l)
for i in range(0,2*n,2):
  answer +=l[i]
print(answer)

N=int(input())
L=sorted(map(int,input().split()))
print(sum(L[::2]))

input()
l=list(map(int,input().split()))
l=sorted(l)
print(sum(l[::2]))

import sys
import math
import random
import itertools
import bisect
from copy import copy
from collections import deque,Counter,defaultdict
from decimal import Decimal
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 9)
INF = 10**9

N = int(input())
L = list(map(int,input().split()))
L.sort()
ans = 0
for i in range(N):
    ans += L[i*2]
print(ans)

import bisect
import heapq
import itertools
import sys
import math
import random
import time
from collections import Counter, deque, defaultdict
from functools import reduce
from operator import xor
from types import FunctionType
from typing import List

mod = 10 ** 9 + 7
sys.setrecursionlimit(10 ** 9)


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


def main():
    N = int(input())
    L = lmi()
    L.sort()
    ans = sum(L[::2])
    print(ans)


def __starting_point():
    main()


__starting_point()

n=int(input())
a=sorted(list(map(int,input().split())))
s=0
for i in range(2*n):
    if(i%2==0):
        s+=a[i]
print(s)

n=input()
l=list(map(int,input().split(" ")))
l.sort()
ans=0
for i in range(0,len(l),2):
  ans+=l[i]
print(ans)

N = int( input())
L = sorted(map( int, input().split()))

ret = 0
for i in range( N ):
  ret += L[ 2 * i ]

print( ret )

N=int(input())
L=sorted(map(int,input().split()))
print(sum(L[::2]))

n = int(input())
l = list(map(int, input().split()))

sort_l = sorted(l)

print(sum(sort_l[-2::-2]))

lines = [[int(num) for num in input().split()] for _ in range(2)]
n = lines[0][0]
skewers = sorted(lines[1])
total = 0
for i in range(n):
  total += skewers[2*i]
print(total)


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

L.sort(reverse=True)

ans=0
for i in range(1,2*N,2):
    ans+=L[i]

print(ans)

n=int(input())
l=sorted(list(map(int,input().split())))
print((sum(l[::2])))


import math
from math import gcd,pi,sqrt
INF = float("inf")
MOD = 10**9 + 7
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)
import itertools
import bisect
import re
from collections import Counter,deque,defaultdict
def iinput(): return int(input())
def imap(): return map(int, input().split())
def ilist(): return list(imap())
def irow(N): return [iinput() for i in range(N)]
def sinput(): return input().rstrip()
def smap(): return sinput().split()
def slist(): return list(smap())
def srow(N): return [sinput() for i in range(N)]

def main():
    n = iinput()
    s = sorted(ilist())[::2]
    print(sum(s))



def __starting_point():
    main()
__starting_point()

def solve():
    n = int(input())
    arr = list(map(int, input().split()))
    arr.sort()
    res = sum(arr[i] for i in range(0, len(arr), 2))
    print(res)

solve()

N = int(input())
A = list(map(int, input().split()))
A2 = sorted(A, reverse=True)

ans = 0
for n in range(N):
  ans += A2[2*n+1]
  
print(ans)

_=input()
n=list(map(int,input().split()))
n.sort()
ans=0
for i in range(0,len(n),2):
  ans+=n[i]
print(ans)

n = int(input())
l = sorted(list(map(int,input().split())))
ans= 0
for i in range(0,n*2,2):
  ans += l[i]
  
print(ans)

N = int(input())
L = list(map(int,input().split()))
L.sort()
print(sum(L[::2]))

n = int(input())
a = list(map(int, input().split()))
a.sort()
ans = 0
for i in range(0, 2 * n, 2):
    ans += a[i]
print(ans)

k = int(input())
li= list(map(int, input().split()))
li.sort()
sum=0
for k in range(len(li)):
  
  if k%2==0:
   
    sum=sum+li[k]
 
print(sum)


N = int(input())
L = list(map(int, input().split()))
L.sort()
print((sum(L[0::2])))


a = int(input())
b = list(map(int, input().split()))
c = sorted(b, reverse=True)
#print(a)
#print(c)
d = 0
#二つとる

#for e in 
'''e.append(c[0])
e.append(c[1])
del c[0]
del c[1]'''
#print(e)
#print(c)
for i in range(a):
  #e = []
  f = 2*i
  g = 2*i+1
  #print(f)
  #print(g)
  
  #e.append(c[f])
  #e.append(c[g])
  #print(e)
  if c[f] == c[g]:
  	d += c[g]
  else:
    d += c[g]
  #print(d)
print(d)

# -*- coding: utf-8 -*-
# get a integer
N = int(input())
# get two integers separated with half-width break
L = list(map(int, input().split()))
# get a string

# output"
L.sort()
L = L[::-1]

r = 0
for i in range(N):
    r += L[1]
    L = L[2:]

print((str(r)))



N=int(input())
L=list(map(int,input().split()))
L.sort()
sum=0
for i in range(0,2*N,2):
  sum+=L[i]
print(sum)

n = int(input())
print((sum(sorted(list(map(int, input().split())))[::2])))


n = int(input())
a = list(map(int,input().split()))
a = sorted(a)
ans = sum(a[::2])
print(ans)

n=int(input())
a=list(map(int,input().split()))
a.sort()
ans=0
for i in range(0,2*n,2):
    ans+=a[i]
print(ans)


def main():
    n = int(input())
    l = list(sorted(map(int, input().split())))
    ans = 0
    for i in range(0, 2*n, 2):
        ans += l[i]
    print(ans)


main()

#a = [input() for i in range(2)]

list = []
for i in range(2):
    a = input()
    list.append(a)

N = list.pop(0)
s = list.pop(0)

stick_list = s.split()

stick_list.sort(key=int)

stick_list = [int(s) for s in stick_list]

sum = 0
for i in stick_list[::2]:
    sum = sum + i
print(sum)


n = int(input())
llist = list(map(int, input().split()))
llist.sort()

ans = 0
for i in range(0, len(llist), 2):
    ans += llist[i]

print(ans)


# -*- coding: utf-8 -*-
import sys
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
input=lambda: sys.stdin.readline().rstrip()
YesNo=lambda b: bool([print('Yes')] if b else print('No'))
YESNO=lambda b: bool([print('YES')] if b else print('NO'))
int1=lambda x:int(x)-1

N=int(input())
L=list(map(int,input().split()))
L.sort(reverse=1)
ans=0
for i in range(N):
    ans+=min(L[i*2],L[i*2+1])
print(ans)

n = int(input())
num = [int(i) for i in input().split(' ')]
num.sort(reverse=True)
m=0
for i in range(1,n+1):
    m+=num[2*i-1]
print(m)


n = int(input())
l = sorted([int(x) for x in input().split(' ')])
l.reverse()
s = 0
for i in range(0, n, 1):
    s += min(l[2*i:2*i+2])
print(s)

n = int(input())
l = list(map(int,input().split()))
l.sort(reverse=True)
print(sum(l[1::2]))

# https://atcoder.jp/contests/agc001/tasks/agc001_a

n = int(input())
l = list(map(int, input().split()))
l.sort()

s = 0
for i in range(0, len(l), 2):
    s += l[i]
print(s)

N = int(input())
A = list(map(int, input().split()))
A.sort()
ans = 0
for i in range(0, len(A), 2):
  ans += min(A[i], A[i + 1])
print(ans)

N = int(input())
L = map(int, input().split())
def skewer(input):
  x = sorted(input, reverse = True)
  result = 0
  for i in range(0,len(x)):
    if i%2 ==1:
      result = result + x[i]
  return result 
print(skewer(L))

n = int(input())
a = list(map(int, input().split()))
a.sort()
c = 0
for i in range(0, n):
	c += min(a[2 * i], a[(2 * i)+1])
print(c)


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

L = sorted(L)

Total = 0
for i in range(N*2):
	if(i%2==0):
		Total+=L[i]

print(Total)

n = int(input())
l = list(map(int, input().split()))
l.sort()
num = 0
for i in range(0,2*n,2):
    num += min(l[i],l[i+1])
print(num)

n = int(input())
array = [ int(x) for x in input().split() ]
array.sort()
res = 0
for index in range(0,n):
  res += min(array[2*index],array[2*index + 1])
print(res)

n = int(input())
l = sorted(list(map(int,input().split())))
ans = 0
for i in range(0,2*n,2):
    ans += l[i]
print(ans)

import sys
def input():
  return sys.stdin.readline().rstrip()

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

ans=0
for i in range(0,2*N,2):
  ans+=L[i]

print(ans)


n=int(input())
l=list(map(int,input().split()))
l=sorted(l)
print(sum([l[2*i] for i in range(n)]))

n = int(input())
l = list(map(int, input().split()))
l.sort()
ans = 0
for i in range(n):
    ans += l[2*i]
print(ans)

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

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

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

L.sort()

ans = 0
for x in L[::2]:
  ans += x

print(ans)

n = int(input())
a = sorted(list(map(int, input().split())))
s = 0
for i in range(2 * n):
  if i % 2 == 0:
    s += a[i]
print(s)

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

L.sort()

ans = 0
for i in range(0, 2 * N, 2):
    ans += L[i]

print(ans)

n=int(input())
l=list(map(int,input().split()))
l.sort()
ans=0
for i in range(0,2*n,2):
    ans+=l[i]
print(ans)

n = int(input())
a = sorted(list(map(int,input().split())),reverse=True)

ans = 0
for i in range(n):
    ans += a[2*i+1]
print(ans)


N = int(input())
L = list(map(int, input().split()))
L = sorted(L)
ans = 0
for i in range(N):
  ans += L[2 * i]
  
print(ans)  

n=int(input())
ans=int(0)

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

A.sort()
for i in range(n):
    ans+=A[i]

all=int(0)
for i in range(n):
    all+=A[2*i]
print(max([ans,all]))

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

# L = sorted(L)

# Total = 0
# for i in range(N*2):
# 	if(i%2==0):
# 		Total+=L[i]

# print(Total)


def skewer(input):
	x = sorted(input, reverse = True)
	result = 0
	for i in range(0,len(x)):
		if i%2 ==1:
			result = result + x[i]
	return result

print(skewer(L))

input()
print(sum(sorted(map(int,input().split()))[::2]))

N=int(input())
L=list(map(int,input().split()))
L.sort()
ans = sum(L[::2])
print(ans)

n=int(input())
l=list(map(int,input().split()))
l.sort()
ans=0
for i in range(0,len(l),2):
    ans+=l[i]
print(ans)

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


n = int(input())
l = list(map(int,input().split()))
l.sort()
print(sum(l[0::2]))

n=int(input())
l=list(map(int, input().split()))
l.sort()
kusi=0
for i in range(n):
  kusi+=l[i*2]
print(kusi)

N=int(input())
L=sorted(list(map(int,input().split())))
ans=0
for i in range(N):
  ans+=L[2*i]
print(ans)

n=int(input())
l=sorted(list(map(int,input().split())))
print(sum(l[::2]))

n=int(input())
arr=list(map(int,input().split()))
arr.sort()
s=0
for i in range(0,(2*n)-1,2):
  s+=arr[i]
print(s)

N = int(input())
L = list(map(int, input().split()))
L.sort()
print(sum(L[::2]))

N=int(input())
*L,=map(int,input().split())
L.sort()
ans=sum(L[2*i]for i in range(N))
print(ans)