
object Main extends App {
  
  val sc = new java.util.Scanner(System.in)
  val n = sc.nextInt()
  val a = Array.fill(3*n)(sc.nextLong()).sorted
  val ans = a.takeRight(a.length - n).zipWithIndex.filter{ case (e, i) => i % 2 == 0}.map(_._1).sum
  println(ans)
}