function Main(input) {
  lines = input.split("\n")
  N = lines[0] * 1
  s = lines[1].split(" ").map(function(i){ return i * 1 })

  cnt = 0
  s = s.sort(function(a, b){ return a - b })
  c = s.length / 2 
  ans = s[c] - s[c-1]
  console.log(ans)
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));