import java.util.*

fun main(args: Array<String>) {
    val scanner = Scanner(System.`in`)
    val n = scanner.nextInt()
    val array = Array(n, {0})
    for(i in 0..n-1){
        array[i] = scanner.nextInt()
    }
    array.sort()
    val index = array.size/2-1
    if(array[index] === array[index+1]) {
        println(0)
        return
    }
    println(array[index+1]-array[index])
}