function main(input) {
  // 入力値（文字列）を改行で区切る
  const inputList = input.split(/\n/);
  const numList = inputList[1].split(/\s/).map(ip => formatNum(ip));
  const half = Math.floor(numList.length / 2);
  numList.sort(compareFunc);
  const result = numList[half] - numList[half - 1];
  console.log(result);
};

// 文字列を数値に変換
function formatNum(str) {
  return Number(str);
};

function compareFunc(a, b) {
  return a - b;
}

main(require("fs").readFileSync("/dev/stdin", "utf8"));
