N = int(eval(input()))

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

# N = 10

# A = [1000000000, 1000000000, 1000000000, 1000000000, 1000000000, 1000000000, 1000000000, 1000000000, 1000000000, 1000000000, 1000000000, 1000000000, 1000000000, 1000000000, 1000000000, 1000000000, 1000000000, 1000000000, 1000000000, 1000000000, 1000000000, 1000000000, 1000000000, 1000000000, 1000000000, 1000000000, 1000000000, 1000000000, 1000000000, 1000000000]

# A = sorted(A)

# print(A)



total = 0

cnt = 0

for i in range(3 * N - 2, 0, -2):

    cnt += 1

    total += A[i]



    if cnt == N:

        break

print(total)

# https://atcoder.jp/contests/agc012/tasks/agc012_a



N = int(eval(input()))

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

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

N = int(eval(input()))
A = list(sorted(map(int, input().split())))
# N = 10
# A = [1000000000, 1000000000, 1000000000, 1000000000, 1000000000, 1000000000, 1000000000, 1000000000, 1000000000, 1000000000, 1000000000, 1000000000, 1000000000, 1000000000, 1000000000, 1000000000, 1000000000, 1000000000, 1000000000, 1000000000, 1000000000, 1000000000, 1000000000, 1000000000, 1000000000, 1000000000, 1000000000, 1000000000, 1000000000, 1000000000]
# A = sorted(A)
# print(A)
total = 0
cnt = 0
for i in range(3 * N - 2, 0, -2):
    cnt += 1
    total += A[i]
    if cnt == N:
        break
print(total)

# https://atcoder.jp/contests/agc012/tasks/agc012_a
N = int(eval(input()))
a = list(sorted(map(int, input().split())))
print((sum(a[N::2])))

+# https://atcoder.jp/contests/agc012/tasks/agc012_a -A = list(sorted(map(int, input().split()))) -# N = 10 -# A = [1000000000, 1000000000, 1000000000, 1000000000, 1000000000, 1000000000, 1000000000, 1000000000, 1000000000, 1000000000, 1000000000, 1000000000, 1000000000, 1000000000, 1000000000, 1000000000, 1000000000, 1000000000, 1000000000, 1000000000, 1000000000, 1000000000, 1000000000, 1000000000, 1000000000, 1000000000, 1000000000, 1000000000, 1000000000, 1000000000] -# A = sorted(A) -# print(A) -total = 0 -cnt = 0 -for i in range(3 * N - 2, 0, -2): -    cnt += 1 -    total += A[i] -    if cnt == N: -        break -print(total) +a = list(sorted(map(int, input().split()))) +print((sum(a[N::2])))