local n = io.read("*n", "*l")
local str = io.read()
local t = {}
for v in str:gmatch("(%d+)") do
  table.insert(t, tonumber(v))
end
table.sort(t)
local sum = 0
for i = 1, n do
  sum = sum + t[n + 2 * i - 1]
end
print(sum)
