
function Main(input) {
  var N = parseInt(input[0], 10);
  var d = input.slice(1).map(w => parseInt(w, 10));

  d.sort((a,b) => a - b);

  var half = N / 2;

  var diff = d[half] - d[half - 1];

  console.log(diff);
}

Main(require("fs").readFileSync("/dev/stdin", "utf8").trim().split(/\n|\s/));