import scala.io.StdIn._
object Main extends App {
  val n = readInt
  val ds = readLine.split(" ").map(_.toInt).sorted
  val l = ds(n / 2 - 1)
  val r = ds(n / 2)
  println(if (l == r) 0 else r - l)
}