fun main(args: Array<String>) {
    val n = readInputLine().toInt()
    
    val ds = readInputLine().split(" ").map { it.toInt() }
    
    val dsList = mutableListOf<Int>()
    
    for (d in ds) {
        dsList.add(d)
    }
    
    dsList.sort()
    
    println("${dsList[n / 2] - dsList[n / 2 - 1]}")
}
 
fun readInputLine(): String {
    return readLine()!!
}
