process.stdin.resume();
process.stdin.setEncoding('utf8');

var lines = []
var reader = require('readline').createInterface({
  input: process.stdin,
  output: process.stdout
});

reader.on('line', (line) => {
  lines.push(line);
});

reader.on('close', () => {
 var n = Number(lines[0]);
 var mid = n / 2 - 1;
 var diff = lines[1].split(' ').sort((a, b)=> a - b);
 var ans = diff[mid+1] - diff[mid];
 console.log(ans);
});