'use strict';

function main(stdin) {
  const input = stdin.split('\n');
  const N = Number(input[0]);
  const d = input[1].split(' ').map(v => parseInt(v, 10)).sort((a, b) => a - b);
  
  const abc = d[N / 2 - 1];
  const arc = d[N / 2];

  console.log(arc - abc);
}

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