import java.util.Scanner

object Main extends App {
  val sc = new Scanner(System.in)
  val N = sc.nextInt
  val d = Array.fill(N)(sc.nextInt)

  val x = d.sorted
  val abc = x(N / 2 - 1)
  val arc = x(N / 2)
  println(arc - abc)
}
