function Main(input) {
  var inputs = input.split("\n");
  var n = parseInt(inputs[0], 10);
  var a = inputs[1].split(" ").map(e => parseInt(e, 10)).sort((x, y) => y - x);
  var sum = 0;
  console.log(a);
  for (var i = 1; i < (n * 3) - 2; i += 2) {
    sum += a[i];
  }
  console.log(sum);
}

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