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 = sorted(list(map(int, input().split())))
ans = 0
for i in range(n):
    ans += l[2*i]
print(ans)

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

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

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

count=0
index=0
while index < len(listL):
    count+=listL[index]
    index+=2

print(count)

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

l.sort(reverse = True)

ans = 0

for i in range(len(l)):
    if i % 2 == 1:
        ans += l[i]

print(ans)

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

l.sort(reverse=True)
ans = 0
for i in range(len(l)):
    if i%2:
        ans += l[i]

print(ans)

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

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

Solution (Python):
N = int(raw_input())
L = map(int,raw_input().split())
L.sort(reverse = True)
ans = 0
for i in xrange(N):
    ans += min(L[2*i],L[2*i+1])
print ans

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

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

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

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

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

A.sort()

ans = 0

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

Solution (Python):
n = input()

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

s = 0

arr.sort()

arr = arr[::2]

for i in arr:
	s += i
	

print(s)

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

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

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

ans = 0

l = sorted(l)

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

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

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

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

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

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

Solution (Python):


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


N = int(input())
L = inpl()
L.sort()

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

print(ans)

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

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

Solution (Python):
import numpy as np

N = int(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)

Solution (Python):
def main18():
    num = int(input(""));
    strbuf = input("");
    strbufs = strbuf.split();
    num2 = num*2
    buf = [];
    for i in range((num2)):
        buf.append(int(strbufs[i]));
    buf.sort();
    result = 0;
    for i in range(num):
        result += buf[2*i];
    print(result);


if __name__ == '__main__':
    main18()

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

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

Solution (Python):
N=int(input())
L=input()
L=L.rstrip().split()
list1=[]
for i in range(2*N):
    list1.append(int(L[i]))
list1.sort()

ans=0
for j in range(2*N):
    if j%2==0:
        ans+=list1[j]
        
print(ans)

Solution (Python):
n=int(input())
s=input().split()
l=[int(s[i]) for i in range(2*n)]
l.sort()
print(sum(l[0::2]))

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

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

b.sort()

su = 0

for i in range(a):
  su += b[2*i]
print(su)

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

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

result = sum(sorted(L)[::2])

print(result)

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

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

Ls.sort()

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

Solution (Python):
def main():
    N = int(input())
    t = input().split(" ")
    a = [int(i) for i in t]

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

    print(sum)
main()

Solution (Python):
N = int(input())
l = [int(x) for x in input().split()]
l_s = sorted(l, reverse = True)

tot = 0

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

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

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

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

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

L.sort()

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

print(guz)

Solution (Python):
n = int(input())
L = list(map(int, 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 = list(map(int, input().split()))
L.sort()
ans = 0
for i in range(1, len(L), 2):
	ans += min(L[i], L[i-1])
print(ans)

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

print(s)

Solution (Python):
N = int(input())
l = sorted(list(map(int, input().split()))).pop
sum = 0
for i in range(N):
  l()
  sum += l()
print(sum)

Solution (Python):
import sys
import heapq
sys.setrecursionlimit(10**8)


N = int(input())
L_li = list(map(int,input().split()))
L_li.sort()
ans = 0

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

print(ans)

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

print(Sum)

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())
l = sorted(list(map(int, input().split())))
print(sum([l[i] for i in range(0, 2 * n, 2)]))

Solution (Python):
N = input()
Li = list(map(int, input().split(" ")))
Li.sort()
total = 0
for i in Li[0::2]:
    total += i
print(total)

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

L.sort()

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

print(total)

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

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

a = 0
for i in range(0,l_len,2):
    a = a + l[i]

print(a)

Solution (Python):
n = int(input())
l = sorted(list(map(int, input().split())))
ans = [l[i] for i in range(len(l)) if i % 2 == 0]
print(sum(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())
lst=list(map(int,input().split()))

i=0
for j in range(n):
    i+=sorted(lst)[2*j]
print(i)

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

L.sort(reverse=True)
if len(L) % 2 == 1:
  L.pop()

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

Solution (Python):
def main():
    n = int(input())
    l = list(map(int, input().split()))
    
    l.sort()
    
    x = 0
    for i in range(n):
        x += min(l[2*i], l[2*i+1])
        
    print(x)
    
    
if __name__ == "__main__":
    main()

Solution (Python):
n = int(input())
arr = list(map(int,input().split()))
arr.sort()
ans = [_ for num,_ in enumerate(arr) if num % 2 == 0]
print(sum(ans))

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

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

arr = map(int,raw_input().split())

arr.sort()

count = 0
for i in range(n):
	count += arr[i*2]

print count

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

Solution (Python):


N = int(input())
L = [int(a) for a in input().split()]

L.sort(reverse=True)

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

Solution (Python):

def num_check(n, l):
    if 2 * n == len(l):
        return True
    else:
        return False


num = int(input())
l = input().split()
list = [int(i) for i in l]

if not num_check(num, list):
    print("Invalid numbers.")
    exit()

list.sort()

meet = 0
for i in range(num):
    num1 = int(list.pop(0))
    list.pop(0)
    meet += num1

print(meet)

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

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

Solution (Python):
from collections import Counter


def getinputdata():
    
    array_result = []

    data = input()

    array_result.append(data.split(" "))

    flg = 1

    try:

        while flg:

            data = input()

            array_temp = []

            if (data != ""):

                array_result.append(data.split(" "))

                flg = 1

            else:

                flg = 0
    finally:

        return array_result


arr_data = getinputdata()

n = int(arr_data[0][0]) * 2

arr = [int(x) for x in arr_data[1]]
arr.sort(reverse=True)

mysum = 0

for v in range(1, n, 2):
    mysum += arr[v]

print(mysum)

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

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

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

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

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

Solution (Python):






if __name__ == '__main__':
    number = int(input())
    l = sorted(list(map(int, input().split())), reverse=True)
    count = 0

    for i in range(number):
        count += min(l[2 * i], l[2 * i + 1])

    print(count)

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

print(ans)

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

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

Solution (Python):


import sys, math, copy




HUGE = 2147483647
HUGEL = 9223372036854775807
ABC = "abcdefghijklmnopqrstuvwxyz"

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

main()

Solution (Python):





n = int(input())

a = [int(i) for i in input().split()]
a.sort(reverse=True)
print(sum(a[1::2]))

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

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

Solution (Python):
def main():
    N = int(input())
    *L, = map(int, input().split())

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

    print(ans)

if __name__ == '__main__':
    main()

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

for i in range(n):
    cnt += min(l_s[2*i], l_s[2*i + 1])

print(cnt)

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*i] for i in range(N)]))

Solution (Python):
n = int(input())
l = [int(i) for i in input().split()]
l.sort()
answer = 0
for i in range(len(l)):
	if i%2==0: answer += l[i]
print(answer)

Solution (Python):
n = int(input())
l = [int(x) for x in input().split()]
l.sort()
print(sum(l[::2]))

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

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

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

Solution (Python):


kusi=int(input())
lst=list(map(int,input().split()))
cnt=1
tabe=0

lst.sort()
lst.reverse()

for i in lst:
    if int(cnt%2)==0:
        tabe+=i
    cnt+=1

print(tabe)

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

L.sort()

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

print(cnt)

Solution (Python):
N = input()
line = list(map(int,input().split()))
line.sort()
o = 0
for i in range(int(len(line)/2)):
    o += line[2*i*1]

print(o)

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

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

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

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

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

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

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

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

l = [int(v) for v in input().split(' ')]

n_l = sorted(l)[::-1]

s = 0

for i in range(n):
    s += min(n_l[i*2], n_l[i*2+1])

print(s)

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

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

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

Solution (Python):
skewer_num = int(input())
skewer_lengths = [int(i) for i in input().split()]
skewer_lengths.sort()
result = sum(skewer_lengths[0::2])
print(result)

Solution (Python):
N = int(input())
src = list(map(int,input().split()))
src.sort()
ans = 0
for a,b in zip(src[::2],src[1::2]):
    ans += a
print(ans)

Solution (Python):

N = int(input())
L = list(map(int, input().split()))
L.sort()
print(sum((x for i, x in enumerate(L) if i % 2 == 0)))

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

array = []
for i in range(0, len(val)-1, 2):
    array.append(min(val[i], val[i+1]))
print(sum(array))

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

Ls_sorted = sorted(Ls, reverse=True)

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

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

solve()

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

L.sort()
count = 0

while len(L) != 0:
    first = L.pop(0)
    second = L.pop(0)
    count += min(first,second)

print(count)

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

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

Solution (Python):
n = input()
a = sorted(map(int, raw_input().split()))
print sum([a[2 * i] for i in xrange(n)])

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

Solution (Python):
N = int(input())
L = sorted(map(int, input().split()))
 
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 = list(map(int, input().split()))
L.sort()
sum = 0
for i in range(N):
    x = L.pop(0)
    y = L.pop(0)
    sum += x
print(sum)

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

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

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

print(ret)

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

Solution (Python):


import sys
import os

n = int(sys.stdin.readline())
s = 0

lenlist = map(int, sys.stdin.readline().strip().split(" "))
lenlist.sort()
for i in range(0,n):
    m = min(lenlist[2*i],lenlist[2*i+1])
    s += m

print s

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
INF = 10 ** 10


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


if __name__ == '__main__':
    main()

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

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

print(ans)

Solution (Python):
input()
L=[int(x) for x in input().split()]
L=sorted(L)
ans=0
for i,l in enumerate(L):
    if i%2==0:
        ans+=l
print(ans)

Solution (Python):



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

L.sort()
L.reverse()

res = 0
for num in range(0, len(L)):
	if (num % 2 != 0):
		res = res + L[num]
print res

Solution (Python):

def f(xs, ys):
    acc = 0
    for x, y in zip(xs, ys):
        acc += min(x, y)
    return acc
n = int(input())
l = sorted(map(int,input().split()))
ans = max(f(l[0::2], l[1::2]), f(l[1::2], l[2::2]))
print(ans)

Solution (Python):
def bbq_easy():
	n = int(raw_input())
	l = map(int, raw_input().split(" "))
	sorted_l = sorted(l, reverse=True)
	print sum(sorted_l[1::2])


if __name__ == "__main__":
	bbq_easy()

Solution (Python):



N = int(raw_input())
L_list = map(int, raw_input().split(" "))

sorted_L = sorted(L_list)
ret = sum(sorted_L[0::2])
print ret

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

L = sorted(L)

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

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

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



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

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

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

Solution (Python):
N = int(raw_input())
A = map(int, raw_input().split())
sum = 0
A.sort()
B = A[::2]
x = 0
for i in B:
    x = x + i
    pass
print x

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

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

Solution (Python):
n = int(raw_input())
a = map(int, raw_input().split())
a.sort()

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

Solution (Python):

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

Solution (Python):

N = int(input())
sticks = list(map(int, input().split()))
sticks.sort()

sum = 0
for num in range(N):
    sum += sticks[2 * num]

print(sum)

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

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

L.sort()
for i in xrange(len(L)/2):
    ans += L[i*2]
    
print ans

Solution (Python):
n = int(raw_input())
ls = map(int, raw_input().split())
ls.sort()
al = [j for i,j in enumerate(ls) if i % 2 == 0]
print sum(al)

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

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

print total

Solution (Python):
N = int(input())
L = [int(i) for i in input().split()]
L.sort()
print(sum([L[i] for i in range(2*N) if not i % 2]))

Solution (Python):
import numpy as np
input();L=sorted(map(int,input().split()))[::-1]
print(sum([min(a,b) for a,b in np.array(L).reshape(-1,2)]))

Solution (Python):
import sys

INF = 10**9+7

stdin = sys.stdin
def na(): return map(int, stdin.readline().split())
def ns(): return stdin.readline().strip()
def nsl(): return list(stdin.readline().strip())
def ni(): return int(stdin.readline())
def nil(): return list(map(int, stdin.readline().split()))

n = ni()
l = nil()
l.sort()

ans = 0
for i in range(0, 2*n-1, 2):
    if(l[i] > l[i+1]):
        ans += l[i+1]
    else:
        ans += l[i]

print(ans)

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


skewers = [int(i) for i in raw_input().split(' ')]
index_done = []
numbers = []

foodusage = 0


for i in range(len(skewers) - 1):
    for j in range(i + 1, len(skewers)):
        if( skewers[i] == skewers[j] and index_done.count(i) == 0 and index_done.count(j) == 0):
            foodusage = foodusage + skewers[i]
            numbers.append(skewers[i])
            
            index_done.append(i)
            index_done.append(j)

            


for x in range(len(numbers)):
    del skewers[skewers.index(numbers[0])]
    del skewers[skewers.index(numbers[0])]
    del numbers[0]




while(len(skewers) != 0):
    
    current_max = max(skewers)
    skewers.remove(current_max)

    next_max = max(skewers)
    skewers.remove(next_max)

    foodusage = foodusage + next_max
    

print foodusage

Solution (Python):
if __name__ == "__main__":
    import sys
    N = int(sys.stdin.readline().strip())
    L = list(map(int, sys.stdin.readline().split()))
    L.sort(reverse=True)
    pairs = [(L[i], L[i+1]) for i in range(0, len(L), 2)]
    print(sum(map(min, pairs)))

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

L.sort()
y = reduce(lambda x, y: x + y, [x if i % 2 == 0 else 0 for i, x in enumerate(L)])
print("{}\n".format(y))

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

Solution (Python):
N=int(input())
L=[]
L=map(int,raw_input().split())
L.sort()
sum=0
for i in range(0,N):
    if(L[i*2]<L[(i*2)+1]):
        sum+=L[i*2]
    else:
        sum+=L[i*2]
print(sum)

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

Solution (Python):
class Scanner:
    def readint(self): return int(input())
    def readstring(self): return input().rstrip()
    def readline(self): return list(map(int, input().split()))
    def reads(self): return list(input().split())
    def newmat(self, n, x): return [[x for i in range(n)] for j in range(n)]

sc = Scanner()
n = sc.readint()
L = sc.readline()
L.sort()
print(sum(L[::2]))

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

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

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

a.sort()
print(sum(a[::2]))

Solution (Python):
N=int(raw_input())
L=sorted(map(int,raw_input().split()),reverse=True)
a=0
for i in xrange(N):
    a+=min(L[i*2],L[i*2+1])
print a

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

Solution (Python):
input()
a = [int(i) for i in input().split()]
a.sort()
print(sum(a[::2]))

Solution (Python):
n=int(raw_input())
a=map(int,raw_input().split())
a.sort()
print sum([a[2*i] for i in range(n)])

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

Solution (Python):
n = int(raw_input())
l = map(int, raw_input().split())
ans = 0
l = sorted(l)
for i in xrange(0,len(l)-1,2):
    ans += min(l[i], l[i+1])
print ans

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

l.sort()
sum = 0
for i in l[::2]:
	sum += i

print sum

Solution (Python):
a = input()
b = map(int,raw_input().split())
b.sort()
c = 0
for i in range(len(b)-1):
	if i % 2 == 0:
		c += b[i]
print c

Solution (Python):
num = int(input())
str = input()
Li = list(map(int,str.split(' ')))
Li.sort()
sum = 0 
if len(Li)%2 == 1:
	Li = Li[1:]
for i in range(0,len(Li),2):
	sum += Li[i]
print(sum)

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

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

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

Solution (Python):
a = int(input())
b = input()

b = b.split()
b = [int(x) for x in b]

b = sorted(b)
b = b[::-1]

def get(a,x):
	if a == 0:
		return 0
	x.pop(0)
	add = x.pop(0)

	return add + get((a-1),x)

print(str(get(a,b)))

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

Solution (Python):
import numpy as np
n = int(raw_input())
l = map(int, raw_input().split())
l.sort()
l = np.array(l).reshape(-1, 2)
print l.T[0].sum()

Solution (Python):
N = int(input())
K = input()
K = "".join(K).split(" ")
K = [int(s) for s in K]
K.sort()
ans=0
for s in range(N):
	if int(K[-1])> int(K[-2]):
		ans+=int(K[-2])
	else:
		ans+=int(K[-1])
	del K[-2:]

print(ans)

Solution (Python):
from sys import stdin
n = int(stdin.readline())
a = map(int,stdin.readline().split())
ans = 0
i = 0
a.sort()
while i<n*2:
    ans += a[i]
    i+=2
print ans

Solution (Python):


n=int(raw_input())
l=map(int,raw_input().split())
l.sort()
l.reverse()
res=0
for i in xrange(0,2*n,2):
 res+=min(l[i],l[i+1])
print res

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

l = [int(s) for s in input().split()]
l.sort()
print(sum(l[2*i] for i in range(n)))

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())
a = list(map(int, input().split()))
a.sort()
s = 0
for i in range(0, len(a), 2):
    s += a[i]
print(s)

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

Solution (Python):

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

L.sort()

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

Solution (Python):

n = int(raw_input())

lis = map(int,raw_input().split(" "))

lis.sort()
count = 0
for var in range(0,len(lis)):
    if var % 2 == 1:
        continue
    count = count + lis[var]
print count

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

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

Solution (Python):
n=input()
k=map(int,raw_input().split())
ans=0
for i,e in enumerate(sorted(k)):
    if i%2==0: ans+=e
print ans

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

Solution (Python):


def max_ingredients(L):
    work_L = L
    ing = 0
    while work_L:
        ing += work_L[-1]
        work_L = work_L[:-2]
    return ing

def main():
    N = int(input())
    L = [int(l) for l in input().split(" ")]
    print( max_ingredients( sorted( L, reverse=True ) ) )

if __name__ == '__main__':
    main()

Solution (Python):
N = input()
L = map(int,raw_input().split(' '))
count = 0
for i in xrange(N):
	L.sort()
	count += min(L.pop(0),L.pop(0))
print count

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

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

Solution (Python):
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time

sys.setrecursionlimit(10**7)

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

a.sort()
print(sum(a[::2]))

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

Solution (Python):
n = int(raw_input())
a = map(int,raw_input().split())
a.sort()
s_l = 0
for i in xrange(0,2*n,2) :
    s_l += a[i]
print s_l

Solution (Python):
n = int(raw_input())
har = sorted(map(int,raw_input().split()))
ans = 0
for i in xrange(0,2*n,2):
 ans += har[i]
print ans

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

Solution (Python):
N = int(raw_input())
L_arr = [int(x) for x in raw_input().split(' ')]
L_arr = sorted(L_arr)
print sum(L_arr[::2])

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

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

Solution (Python):


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