def main
  problem_num = gets.chomp.to_i
  difficulty = gets.chomp.split(' ').map(&:to_i).sort

  # difficulty[(problem_num)/2-1]<Z<=difficulty[(problem_num)/2]

  print(difficulty[problem_num / 2] - difficulty[problem_num / 2 - 1])
end

main
