fun main(args: Array<String>) {
  val n = readLine()!!
  val dList = readLine()!!.split(" ").map { it.toInt() }
  val sortedList = dList.sorted()
  val dLeft = sortedList[dList.size/2 - 1]
  val dRight = sortedList[dList.size/2]
  println(dRight - dLeft)
}