const main = (inputs) => {
  var N = inputs[0]-0;
  var list = inputs[1].split(" ").map(v=>v-0);
  var ans = 0;
  list = list.sort((a,b)=>a-b);

  console.log(list[N/2]-list[N/2-1]);
}

main(require('fs').readFileSync('/dev/stdin', 'UTF-8').trim().split("\n"));
