Problem:
 Score : 200 points    Problem Statement 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 1 2
1 3 1 2      Sample Output 1 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 .       Sample Input 2 5
100 1 2 3 14 15 58 58 58 29      Sample Output 2 135

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

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

Solution (Python):
import numpy as np
N=int(input())
L=[int(i) for i in input().split()]
result=0
for i in range(0,len(L),2):
    result+=np.sort(L)[i]
print(result)

Solution (Python):
N = int(input())
L = [int(_) for _ in input().split()]
L = sorted(L)
print(sum(L[::2]))

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

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

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

Solution (Python):
n=int(input());l=sorted(list(map(int,input().split())))[::-1];
L=0
for i in range(0,len(l),2):
  L+=min(l[i],l[i+1])
print(L)

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

Solution (Python):

'''
問題
2本の串にいくつかの具材を刺して串焼きをN個つくりたい
串は2N本ありi番目の串の長さはLi
2本の串のうち短いほうの長さをxとすると串焼きには最大で具材をx個刺せる
うまく串を組み合わせたとき具材は全部で最大何個刺せるか?

ただしNは1以上100以下
Liは1以上100以下

考察
串の長さの差が小さいほどよいのでLiをソートして奇数番目に小さい値の総和をとる
'''

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

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

Solution (Python):



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


def main():
    input()
    nums = rli()
    nums.sort()
    ans = 0
    for i in range(0, len(nums), 2):
        ans += nums[i]
    print(ans)


if __name__ == '__main__':
    main()

Solution (Python):
N = int(input())
L = [int(i) for i in input().split()]
L.sort()            

print(sum([L[i] for i in range(0,2*N,2)]))

Solution (Python):
N = int(input())
a = list(map(int, input().split()))
a = list(sorted(a, reverse=True))
print(sum(a[1::2]))

Solution (Python):
def main():
    n=input()
    kushi=map(int,raw_input().split())
    print answer(n,kushi)

def answer(n,kushi):
    kushi.sort()
    kushi.reverse()
    sums=0
    for i in range(1,2*n,2):
        sums+=kushi[i]
    return sums
        

if __name__=='__main__':
    main()

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

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

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

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

Solution (Python):
import sys
stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
nn = lambda: list(stdin.readline().split())
ns = lambda: stdin.readline().rstrip()

n = ni()
L = na()

A = sorted(L, reverse=True)[1::2]

print(sum(A))

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

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

Solution (Python):
n = int(input())

items = input()
li = list(map(int, items.split()))








li = sorted(li)
print(sum([val for i, val in enumerate(li) if i % 2 == 0]))

Solution (Python):
n = int(input())
a = [ int(x) for x in input().split() ]
a.sort()

t = []
i = 0

while i+1 < len(a):
    t += [ min(a[i], a[i+1]) ]
    i += 2

print(sum(t))

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

cnt = 0
for i in range(0,N*2-1,2):
  cnt += min(L[i:i+2])
print(cnt)

Solution (Python):
num = int(input())
num_list = sorted(list(map(int, input().split())))
i = 0
sum = 0
while i < num * 2:
  sum += num_list[i]
  i += 2
print(sum)

Solution (Python):
n = int(input())
L = sorted([int(i) for i in input().split()], reverse = True)

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

Solution (Python):
n = int(input())
lst = list(map(int, input().split()))
lst.sort()
ret = 0
for i in range(n):
    ret += lst[2*i]

print(ret)

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

if __name__=="__main__":
    main()

Solution (Python):

from collections import defaultdict
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS():return list(map(list, sys.stdin.readline().split()))
def S(): return list(sys.stdin.readline())[:-1]
def IR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = I()
    return l
def LIR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = LI()
    return l
def SR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = S()
    return l
def LSR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = SR()
    return l
mod = 1000000007


n = I()
l = LI()
l.sort()
ans = 0
for i in range(n):
    ans += l[2*i]
print(ans)

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

Solution (Python):
N = int(input())
L = [int(i) for i in input().split()]

L.sort()
ans = 0
for i,j in zip(L[::2], L[1::2]):
    ans += min(i, j)

print(ans)

Solution (Python):
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)

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

Solution (Python):
n = int(input())
Ls = list(map(int,input().split()))
Ls.sort()
ans = 0
for L in Ls[0::2]:
    ans += L
    
print(ans)

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

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

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

Solution (Python):
a = 0
n = int(input())
le = list(map(int, input().split()))
le.sort()
le2 = []
le2 = le[0::2]
print (str(sum(le2)))

Solution (Python):
N = int(input())
L = [int(i) for i in input().split()]
L.sort()
ans = 0
while len(L) != 0:
    ans += min(L.pop(0), L.pop(0))
print(ans)

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

Solution (Python):
N=int(input())
L=list(map(int,input().split()))
L.sort()
i=0
sum1=0
while i<2*N:
    sum1+=L[i]
    i=i+2
print(sum1)

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

Solution (Python):
n=int(input())
l=[int(i) for i in input().split()]
l.sort()

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

Solution (Python):
N = int(input())
L = list(map(int, input().split()))
L.sort()

i = 0
res = 0
for _ in range(N):
    res += min(L[i], L[i+1])
    i = i + 2
    
print(res)

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

Solution (Python):
n=int(input())
l=list(map(int,input().split()))
l.sort()
ans=0
i=0
while i<n*2-1:
    ans+=l[i]
    i+=2
print(ans)

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

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

Solution (Python):
n = int(input())
ll = sorted(list(map(int, input().split())))

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

Solution (Python):
n=int(input())
kushi = list(map(int,input().split()))
kushi.sort()
result=0
for i in range(len(kushi)//2):
    result+=kushi[i*2]
print(result)

Solution (Python):


import sys

INF = float('inf')
MOD = 10 ** 9 + 7

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x) - 1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def II(): return int(sys.stdin.readline())
def SI(): return input()


def main():
    n = II()
    L = LI()

    L.sort()
    ans = 0
    for i in range(0, 2 * n, 2):
        ans += min(L[i], L[i + 1])

    return ans


print(main())

Solution (Python):
N=int(input())
List =[int(i) for i in input().split()]
List.sort()
new_list = List[0::2]
print(sum(new_list))

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

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

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

print(ans)

Solution (Python):
_,*a=map(int,open(0).read().split())
a=sorted(a)
if len(a)%2==1:
  del a[0]
print(sum(a[s]for s in range(0,len(a),2)))

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

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

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

Solution (Python):
import numpy as np
from sys import stdin
N=int(stdin.readline().rstrip())
data=[int(x) for x in stdin.readline().rstrip().split()]
print(sum(sorted(data)[0::2]))

Solution (Python):
n = int(input())
kusi = [int(x) for x in input().split()]
ans = 0
kusi.sort(reverse = True)
for i in range(n):
  ans += kusi[i*2+1]
print(ans)

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

Solution (Python):
n = int(input())
table = list(map(int,input().split()))
table.sort()
count = 0
for i in range(2*n):
    if i%2 == 0:
        count += table[i]
    else:
        pass
print(count)

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

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

print(ans)

Solution (Python):

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

Solution (Python):
n = int(input())
l = list(int(i) for i in input().split())
ans = 0
l2 = sorted(l,reverse =True)
for i in range(0,2*n-1,2):
  ans += min(l2[i],l2[i+1])
print(ans)

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

cnt = 0
sL = sorted(L)
for i in range(N):
  sL.pop()
  cnt += sL.pop()
print(cnt)

Solution (Python):
n = int(input())
l = [int(m) for m in input().split()]

l.sort()

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

print(ans)

Solution (Python):
N = int(input())
L = list(map(int, input().split(" ")))

L.sort(reverse=True)
print(sum(L[1::2]))

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

l.sort()
l.reverse()
print(sum(l[1::2]))

Solution (Python):
a=int(input())
b = sorted(list(map(int,input().split())))
print(sum(b[0:len(b):2]))

Solution (Python):
n = int(input())
l = input().split(" ")
l = [int(x) for x in l]

l.sort(reverse = True)
s= 0
for i in range(0, n):
  a = i * 2
  b = i * 2 + 1
  m = min(l[a], l[b])
  s += m
print(s)

Solution (Python):
N = int(input())
kushi = 2 * N

l = input().rstrip().split(" ")
L = []
for i in range(kushi):
    L.append(int(l[i]))

L.sort()
x = 0
for i in range(len(L)):
    if i % 2 == 0:
        x += L[i]
print(x)

Solution (Python):
n = int(input())
l2n = [int(l) for l in input().split(" ")]
l2n = sorted(l2n)
ln = [l2n[i] for i in range(0, len(l2n), 2)]
res = sum(ln)
print(res)

Solution (Python):
N = int(input())
L = map(int, input().split(" "))

L = sorted(L)

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

print(tmp)

Solution (Python):

import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline

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

A = sorted(A)
print(sum(A[0::2]))

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

L = sorted(L)

ans = 0

while len(L) :
    if len(L) == 1 :
        ans += L[0]
        L.pop(0)
    else :
        ans += L.pop(0)
        L.pop(0)

print(ans)

Solution (Python):
import sys
stdin = sys.stdin
 
sys.setrecursionlimit(10**5) 
 
def li(): return map(int, stdin.readline().split())
def li_(): return map(lambda x: int(x)-1, stdin.readline().split())
def lf(): return map(float, stdin.readline().split())
def ls(): return stdin.readline().split()
def ns(): return stdin.readline().rstrip()
def lc(): return list(ns())
def ni(): return int(stdin.readline())
def nf(): return float(stdin.readline())

n = ni()
l = sorted(list(li()))
print(sum(l[::2]))

Solution (Python):
N = int(input())
L = list(map(int,input().split()))
L.sort()
print(sum(min(a,b) for a,b in zip(L[::2],L[1::2])))

Solution (Python):
def inpl(): return list(map(int, input().split()))
N = int(input())
L = sorted(inpl())
ans = 0
for i in range(N):
    ans += min(L[2*i], L[2*i+1])
print(ans)

Solution (Python):
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)

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

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

Solution (Python):
a = input()
lst = list(map(int,input().split(" ")))
lst.sort()
ans=0
for i in range(int(len(lst)/2)):
  ans += lst[len(lst)-2*i-2]
 
print(ans)

Solution (Python):
N = int(input())
a = list(map(int, input().split()))

a.sort()

count = 0
for i in range(N):
    count += a[2*i]

print(count)

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

Solution (Python):


import sys, re
from collections import deque, defaultdict, Counter
from math import sqrt, hypot, factorial, pi, sin, cos, radians
if sys.version_info.minor >= 5: from math import gcd
else: from fractions import gcd 
from heapq import heappop, heappush, heapify, heappushpop
from bisect import bisect_left, bisect_right
from itertools import permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from functools import reduce, partial
from fractions import Fraction
from string import ascii_lowercase, ascii_uppercase, digits

def input(): return sys.stdin.readline().strip()
def ceil(a, b=1): return int(-(-a // b))
def round(x): return int((x*2+1) // 2)
def fermat(x, y, MOD): return x * pow(y, MOD-2, MOD) % MOD
def lcm(x, y): return (x * y) // gcd(x, y)
def lcm_list(nums): return reduce(lcm, nums, 1)
def gcd_list(nums): return reduce(gcd, nums, nums[0])
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

N = INT()
L = LIST()

L.sort(reverse=True)
ans = 0
for i in range(1, N*2, 2):
    ans += L[i]
print(ans)

Solution (Python):
N = int(input())
l = [int(x) for x in input().split(" ")]

import numpy as np
ans=0
while len(l) !=0:
    x=0
    y=0
    x+=max(l)
    l.pop(np.argmax(l))
    y+=max(l)
    l.pop(np.argmax(l))
    ans+=min(x,y)
print(ans)

Solution (Python):
input_word = input()
N = int(input_word)
input_word = input()
tmp_list = input_word.split(" ")
input_list = [ int(i) for i in tmp_list ]
input_list.sort()
output = 0
for i in range(N):
  output += input_list[2*i]
print(output)

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

Solution (Python):
N = int(input())
arr = [int(i) for i in input().split()]
arr.sort()

result = 0

for i in range(len(arr)//2):
  result += arr[i*2]
print(result)

Solution (Python):
N = int(input())
l = [int(i) for i in input().split()]

l.sort()
count = 0

for i in range(len(l) // 2) :
	count += l[i * 2]

print(count)

Solution (Python):
N = int(input())
L = sorted([int(l) for l in input().split()], reverse=True)
print(sum(L[1::2]))

Solution (Python):
input()
a=list(map(int,input().split()))
a.sort()
ans=0
while(len(a)>0):
  ans+=a[0]
  a=a[2:]
print(ans)

Solution (Python):
_ = input()
a = [int(i) for i in input().split()]
a.sort()
b = [a[i] for i in range(len(a)) if i % 2 == 0 ]
print(sum(b))

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

Solution (Python):
import sys
input = sys.stdin.readline
N = int(input())
kushi = sorted(list(map(int,input().split())))

sum = 0
for i in range(0,2*N,2):
    sum += kushi[i]
print(sum)

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

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

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

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

Solution (Python):
N = int(input())
inputs = sorted([int(i) for i in input().split()])

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

print(ans)

Solution (Python):
n = int(input())
A = sorted(list(map(int, input().split())))
ans = 0
flag = True
for i in reversed(range(len(A))):
  if flag is False:
    flag = True
    continue
  if i - 1 < 0:
    continue
  ans += A[i - 1]
  flag = False
print(ans)

Solution (Python):
import numpy as np
n = int(input())
l = list(map(int, input().split()))
ans = np.sum(np.sort(l)[np.arange(0, n*2, 2)])
print(ans)

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

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

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

Solution (Python):
N=int(input())
L=list(map(int,input().split(' ')))

L.sort()
L=L[::2]
print(sum(L))

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

Solution (Python):
a = int(input())
l = list(map(int, input().split()))
l.sort()
res=0
for i in range(len(l)//2):
    res+=l[i*2]
print(res)

Solution (Python):
import sys
from collections import deque
import copy
import math
def get_read_func(fileobject):
    if fileobject == None :
        return raw_input
    else:
        return fileobject.readline


def main():
    if len(sys.argv) > 1:
        f = open(sys.argv[1])
    else:
        f = None
    read_func = get_read_func(f);
    input_raw = read_func().strip().split()
    [N] = [int(input_raw[0])]
    input_raw = read_func().strip().split()
    L = []
    for i in range(2 * N):
        L.append(int(input_raw[i]))

    L.sort(reverse=True)

    count = 0
    for i in range(0,len(L),2):
        if i + 1 < len(L):
            count += min(L[i], L[i + 1])
    print count



if __name__ == '__main__':
    main()

Solution (Python):
N = int(input())
L = list(map(int, input().split()))
ans = 0

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

print(ans)

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

Solution (Python):
a = int(input())
ar = list(map(int,input().split(" ")))
ar.sort()
count = 0
for i in range(0,a*2,2):
    count += min(ar[i],ar[i+1])
print(count)

Solution (Python):
n=int(input())
result = 0
lst=sorted(list(map(int,input().split())))
for i in range(len(lst)):
    if i%2 == 0:
        result += lst[i]
print(result)

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

Solution (Python):
N = int(input())
L = list(map(int,input().split()))
L.sort(reverse=True)

ans = 0
for a,b in zip(L[::2],L[1::2]):
    ans += min(a,b)
print(ans)

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

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

Solution (Python):
import sys
stdin = sys.stdin
 
sys.setrecursionlimit(10**5) 
 
def li(): return map(int, stdin.readline().split())
def li_(): return map(lambda x: int(x)-1, stdin.readline().split())
def lf(): return map(float, stdin.readline().split())
def ls(): return stdin.readline().split()
def ns(): return stdin.readline().rstrip()
def lc(): return list(ns())
def ni(): return int(stdin.readline())
def nf(): return float(stdin.readline())

n = ni()
l = sorted(list(li()))
print(sum(l[0::2]))

Solution (Python):
N=int(input())
L=list(map(int, input().split()))
L_sort = sorted(L)
temp=0

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

print(temp)

Solution (Python):



def main():
    """Function."""
    n = int(input())
    kushi = list(map(int, input().split()))
    kushi.sort()

    total = 0
    for i in range(n):
        total += kushi[i*2]
    print(total)


if __name__ == "__main__":
    main()

Solution (Python):

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

Solution (Python):
n = int(input())
Ls = list(map(int, input().split()))

Ls.sort(reverse=True)

diff = []
i = 0
while i + 1 <= len(Ls) :
    diff.append( min(Ls[i], Ls[i+1]) )
    i += 2

diff.sort(reverse=True)
ans = 0
for i in range(n):
    ans += diff[i]

print(ans)

Solution (Python):

N = int(input())
lst = sorted(map(int, input().split()))
print(sum([lst[i] for i in range(2*N) if i %2==0]))

Solution (Python):

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

cnt = 0
for i in range(0, 2*N, 2):
    cnt += min(lst[i], lst[i+1])
print(cnt)

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

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

Solution (Python):
N = int(input())
meats = list(map(int, input().strip().split()))
meats.sort()
answer = 0
index = 0
for meat in meats:
    if(index % 2 == 0):
        answer += meat
    index += 1
print(answer)

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

Solution (Python):
n = int(input())
l = [int(i) for i in input().split()]
l = sorted(l)


count = 0

for i in range(n):
    count += l[i*2]
    
print("{}".format(count))

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

Solution (Python):
n = int(input())

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

x.sort()

ans = 0

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

Solution (Python):
N = int(input())

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

L.sort()

ans = 0

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

Solution (Python):
"""取込"""
n = int(input())
data = sorted([int(i) for i in input().split(" ")])

"""問題"""

score = sum(data[-2::-2])

"""出力"""
print(score)

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

Solution (Python):
n = int(input())

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

l.sort()
res = 0
for i in range(n):
    res += l[2*i]
print(res)

Solution (Python):
input()
print(sum(sorted([int(_) for _ in input().split()])[0::2]))

Solution (Python):
N = int(input())

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

L.sort()

ans = 0

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

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

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

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

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

Solution (Python):

n = int(input())
kusi = [int(s) for s in input().split()]
kusi.sort()

bbq = []

cnt = 0

for i in range(0, 2*n, 2):
    cnt += kusi[i]
    
print(cnt)

Solution (Python):
a = int(input())
b = list(map(int,input().split()))

b = sorted(b)
print(sum(b[0::2]))

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

l.sort()
m = 0
for i in range(n):
    m = m + l[2*i]

print(m)

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

Solution (Python):
n=int(input())
a=list(map(int,input().split()))
a.sort()
b=a[::2]
print(sum(b))

Solution (Python):
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
import sys
sys.setrecursionlimit(10000)
INF = float("inf")
YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"
dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]
dy8, dx8 = [0, -1, 0, 1, 1, -1, -1, 1], [1, 0, -1, 0, 1, 1, -1, -1]


def inside(y, x, H, W):
    return 0 <= y < H and 0 <= x < W


def ceil(a, b):
    return (a + b - 1) // b



def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a % b)



def lcm(a, b):
    g = gcd(a, b)
    return a / g * b


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

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



if __name__ == '__main__':
    main()

Solution (Python):
N=int(input())
L=list(map(int,input().strip().split()))
an=0
for i in range(N):
    kusi=[]
    kusi.append(min(L))
    L.remove(min(L))
    kusi.append(min(L))
    L.remove(min(L))
    an+=min(kusi)
print(an)

Solution (Python):
import sys

def main():
    x = int(input())
    lst = list(int(x) for x in input().split(' '))
    lst.sort()
    ans = 0
    for i in range(0,x*2,2):
        ans += int(lst[i])
    print(ans)

main()

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

print(num)

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

Solution (Python):
n = int(input())
l = map(int, input().split())
l = sorted(l)

ans = 0
for i in range(n):
    a = l[2 * i]
    b = l[2 * i + 1]
    ans = ans + min(a, b)

print(ans)

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

Solution (Python):
N = int(input())
l_list = list(map(int, input().split()))

l_list.sort()

result = 0

for i in range(0, 2*N, 2):
    l1 = l_list[i]
    result += l1
print(result)

Solution (Python):
N = int(input())
l_list = list(map(int, input().split()))

l_list.sort()

result = 0

for i in range(0, 2*N, 2):
    l1 = l_list[i]
    l2 = l_list[i+1]

    min_l = min(l1, l2)
    result += min_l
print(result)

Solution (Python):
n = int(input())

a = list(map(int, input().split()))
a.sort()

print(sum(map(min, zip(a[::2], a[1::2]))))

Solution (Python):
n = int(input())
l = list(map(int,input().split()))
res = 0

l.sort()
l.reverse()

for i in range(n):
	point = 1 + 2*i
	res += l[point]
else:
	print(res)

Solution (Python):
N = int(input())
L = list(map(int, input().split()))
ans = 0
L.sort()

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

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

Solution (Python):
import collections

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

LL = []
dic = collections.Counter(L)
ans = 0
for k,v in dic.items():
    if v == 1:
        LL.append(k)
    else:
        ans += k*(v//2)
        if v%2 == 1:
            LL.append(k)

LL = sorted(LL)
for l in LL[::2]:
    ans += l

print(ans)

Solution (Python):
from sys import stdin


def main() -> None:
    n = next_int()
    l = [next_int() for _ in range(2 * n)]
    l.sort()

    ans = sum(l[::2])
    print(ans)


def next_int() -> int:
    return int(next_str())


def next_str() -> str:
    result = ""
    while True:
        tmp = stdin.read(1)
        if tmp.strip() != "":
            result += tmp
        elif tmp != '\r':
            break
    return result


if __name__ == '__main__':
    main()

Solution (Python):
from sys import stdin


def main() -> None:
    n = next_int()
    l = [next_int() for _ in range(2 * n)]
    l.sort()

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


def next_int() -> int:
    return int(next_str())


def next_str() -> str:
    result = ""
    while True:
        tmp = stdin.read(1)
        if tmp.strip() != "":
            result += tmp
        elif tmp != '\r':
            break
    return result


if __name__ == '__main__':
    main()

Solution (Python):
A = int(input())
rate = []
rate = list(map(int,input().strip().split(' ')))
rate.sort(reverse=True)
i = 0
sum = 0
while i < A :
    sum = sum + rate[2*i+1]
    i = i + 1
print(sum)

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

Solution (Python):
input()
datas = sorted(map(int, input().split()), reverse=True)
print(sum([min(datas[x:x+2]) for x in range(0, len(datas), 2)]))

Solution (Python):
n = int(input())
lis = list(map(int, input().split(' ')))

ret = 0

for i in range(n):
  
  pair1 = max(lis)
  lis.remove(pair1)
  pair2 = max(lis)
  lis.remove(pair2)
  
  ret += pair2
  
print(ret)

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

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

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