object Main extends App {

  val n = scala.io.StdIn.readInt()
  val dArr = scala.io.StdIn.readLine().split(" ").map(_.toLong)

  def solve(): Long = {
    val sortedArr = dArr.sorted
    val half = n / 2
    sortedArr(half) - sortedArr(half - 1)
  }
  println(solve)

}
