fun main(args: Array<String>) {
    val n = readLine()?.toInt() ?: return
    val result = readLine()
        ?.split(" ")
        ?.map { it.toLong() }
        ?.sortedDescending()
        ?.dropLast(n)
        ?.filterIndexed { index, l -> index % 2 == 1 }
        ?.sum()
        ?: return
    println(result)
}