import scala.io.StdIn

object Main {

  def main(args: Array[String]) {

    val n: Int = StdIn.readLine().toInt
    val ds: Vector[Int] = StdIn.readLine().split(' ').toVector.map(_.toInt)

    val sorted = ds.sorted
    println(sorted(n / 2) - sorted(n / 2 - 1))

  }

}
