fun main(args: Array<String>) {
    val n = readLine()!!.toInt()
    val xs = readLine()!!.split(" ").map { it.toInt() }.toIntArray()
    xs.sort()
    val x1 = xs[n / 2 - 1]
    val x2 = xs[n / 2]
    println(x2 - x1)
}