import java.util.Scanner

object Main extends App {

  val sc = new Scanner(System.in)

  val n = sc.nextInt
  val dl = Vector.fill(n)(sc.nextInt).sorted

  val upper = dl(n / 2 )
  val lower = dl(n / 2 - 1)

  val res =
    if(upper == lower) 0
    else upper - lower

  println(res)
}