object Main extends App {
  val N = io.StdIn.readLine().toInt
  val d = io.StdIn.readLine().split(" ").map(_.toInt)
  val sortedD = d.sortBy(identity)
  val mid = N / 2
  val a1 = sortedD(mid - 1)
  val a2 = sortedD(mid)
  println(a2 - a1)
}