
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 = for (i <- 0 until n) yield a(i+n)
  println(ans.sum)
}