import scala.math.abs

object Main extends App {
  val sc = new java.util.Scanner(System.in) 
  sc.useDelimiter("\n")
  val n = sc.nextInt()
  val d = sc.next().split(" ").map(_.toInt).toList.sorted
  val abc = d(n/2-1)
  val arc = d(n/2)
  println(arc - abc)
}