import java.util.*
import java.math.*

fun main(args: Array<String>) {

//    var (A,B,C,D) = readLine()!!.split(" ").map { it.toLong() }
    var N = readLine()!!.toInt()
//    val D = readLine()!!.split(" ").map { it.toLong() }
    val D = readLine()!!.split(" ").map { it.toInt() }.toIntArray()
    D.sort()
    println(D[N/2] - D[N/2-1])

//    println("%.9f".format(ans))
}
