fun main(args: Array<String>) {
    val n = readLine()!!.toInt()
    val dList = readLine()!!.split(" ").map { it.toInt() }.toIntArray()
    dList.sort()

    val centerLeft = dList[n / 2 -1]
    val centerRight = dList[n / 2]
    println(centerRight - centerLeft)
}
