def slove():

    import sys

    input = sys.stdin.readline

    n = int(input().rstrip('\n'))

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

    a.sort(reverse=True)

    print((sum(a[1:n*2:2])))





if __name__ == '__main__':

    slove()

import sys





def solve():

    readline = sys.stdin.buffer.readline

    mod = 10 ** 9 + 7

    n = int(readline())

    a = list(map(int, readline().split()))

    a.sort(reverse=True)

    t = 0

    for i in range(1, n * 2, 2):

        t += a[i]

    print(t)





if __name__ == '__main__':

    solve()

def slove():
    import sys

    input = sys.stdin.readline
    n = int(input().rstrip("\n"))
    a = list(map(int, input().rstrip("\n").split()))
    a.sort(reverse=True)
    print((sum(a[1 : n * 2 : 2])))


if __name__ == "__main__":
    slove()

import sys


def solve():
    readline = sys.stdin.buffer.readline
    mod = 10**9 + 7
    n = int(readline())
    a = list(map(int, readline().split()))
    a.sort(reverse=True)
    t = 0
    for i in range(1, n * 2, 2):
        t += a[i]
    print(t)


if __name__ == "__main__":
    solve()

-def slove(): -    import sys +import sys -    input = sys.stdin.readline -    n = int(input().rstrip("\n")) -    a = list(map(int, input().rstrip("\n").split())) + +def solve(): +    readline = sys.stdin.buffer.readline +    mod = 10**9 + 7 +    n = int(readline()) +    a = list(map(int, readline().split())) -    print((sum(a[1 : n * 2 : 2]))) +    t = 0 +    for i in range(1, n * 2, 2): +        t += a[i] +    print(t) -    slove() +    solve()