import scala.io.{StdIn => in}

object Main extends App {
  val n = in.readInt
  val d = in.readLine.split(" ").map(_.toInt).sorted

  val low = d((n-1) / 2)
  val hi  = d(n / 2)

  val ans = hi - low

  println(ans)
}