object Main {
	def main(args: Array[String]): Unit = {
		val sc = new java.util.Scanner(System.in)

    	val n: Int = sc.nextInt
        val ax: Array[Int] = Array.fill(3*n)(sc.nextInt).sorted.reverse
        
        var sum: Long = 0
        for (i <- 0 until (ax.length - n) by 2) {
            sum = sum + ax(i+1)
        }
        
        println(sum)
	}
}