object Main {

  def main(args: Array[String]): Unit = {
    val sc = new java.util.Scanner(System.in)
    val N = sc.nextInt
    val d = Array.fill[Int](N)(sc.nextInt)

    val sorted = d.sorted
    val res = if (N % 2 == 0) {
      sorted(N / 2) - sorted(N / 2 - 1)
    } else {
      0
    }

    println(res)
  }
}