object Main{
  def main(args: Array[String]){
      	val ct = io.StdIn.readLine().trim().toInt
		val nums = io.StdIn.readLine().split(" ").map(_ .toInt)
      println(solve(ct, nums).toString.trim());
  }
  def solve(ct :Int,nums:Array[Int]):Int ={
    val soretedNms = nums.sorted
    soretedNms((ct/2) )  - soretedNms(ct/2 - 1 )
  }
}