function Main(input) {
  var tmp = input.split('\n');
  var n = tmp[0];
  var arr = tmp[1].split(' ');
  for ( var i = 0; i < arr.length; i++) {
    arr[i] = parseInt(arr[i]);
  }

  arr.sort((a,b) => {
    return (a < b ? -1: 1);
  })
  console.log(arr[arr.length / 2] - arr[arr.length / 2 - 1 ])

  

}

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