'use strict'
function main(i) {
  i = i.trim().split('\n')
  const n = i[0] - 0
  i = i[1].split(' ').map(v => v - 0).sort((a, b) => a - b)
  let c = Math.floor(n/2)-1
  console.log(i[c+1] - i[c])
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
