fun main() {
    val n = readLine()!!.toInt()
    val a = readLine()!!.split(" ").map { it.toLong() }.sorted().reversed()

    var total = 0L
    for (i in  0 until n) {
        total += a[i * 2 + 1]
    }

    print(total)
}