function Main(input) {
	var len = parseInt(input.split("\n")[0]) * 3;
  var list = input.split("\n")[1].split(" ");
   var output = 0;
  list.sort(function(a,b){
  	return parseInt(b) - parseInt(a);
  });
  
  var count = 1;
  while(count != len - 1){
    output += parseInt(list[count]);
    count += 2
  }
  console.log(output);
}

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