'use strict'
const Main = (arg) => {
  let input = arg.trim().split('\n');
  let n = parseInt(input[0]);
  let dArr = input[1].split(' ').map(Number);
  // console.log({ n, dArr });

  dArr.sort((a, b) => a - b);
  let nL = dArr[(dArr.length) / 2 - 1];
  let nR = dArr[(dArr.length) / 2];
  // console.log({nL, nR})
  let answer = nR - nL;
  console.log(answer)



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