local read = io.read
local remove = table.remove

local N = read("*n")
local a = {}
for i = 1, 3*N do
	a[i] = read("*n")
end

table.sort(a)

local sum = 0LL
for i = 1, N do
	remove(a)
	sum = sum + remove(a)
end

print(tostring(sum):sub(1, -3))
