import java.util.*

fun main(args: Array<String>) {
    val sc = Scanner(System.`in`)
    val length: Int = sc.nextInt()
    val list = mutableListOf<Int>()

    for (x in 0 until length) {
        list.add(sc.nextInt())
        //println("$x : ${list[x]}")
    }
    list.sort()

    for (x in 0 until length) {

        //println("$x : ${list[x]}")

    }

    println(list[length / 2] - list[length / 2 - 1])
}