"use strict"
function Main(input) {
  input = input.trim().split('\n');
  const N = Number(input[0].trim());
  let A = input[1].trim().split(' ').map(Number).sort((a, b) => b-a);
  let O = A.slice(N).slice(0, N);
  let ret = O.reduce((acc, val) => acc += val);
  console.log(ret)


}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));