'use strict';
function main(input) {
  const args = input.split('\n'),
        N = parseInt(args[0]),
        D = args[1].split(' ');
  let DSorted = D.sort((a,b) => parseInt(a) - parseInt(b));
  let ans = parseInt(DSorted[N/2]) - parseInt(DSorted[N/2-1]);
  console.log(ans);
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));