fun main(args: Array<String>){
    val n = readLine()!!.toInt()
    var list = readLine()!!.split(" ").map(String::toInt).toMutableList()

    list.sort()

    val half = list.size/2

    if(list[half-1] == list[half]){
        println(0)
    }
    else{
        println(list[half] - list[half-1])
    }
}