object Main extends App {
  val sc = new java.util.Scanner(System.in)
  val N = sc.nextInt()
  val participants = List.fill(3 * N)(sc.nextLong())
  println(loop(participants.sorted(Ordering[Long].reverse), 0L, N))
  @scala.annotation.tailrec
  def loop(longs: Seq[Long], acc: Long, count: Int): Long = longs match {
    case _ :: second :: xs if count != 0 => loop(xs, acc + second, count - 1)
    case _ => acc
  }
}
