'use strict'

const main = (INPUT) => {
  const input = INPUT.split('\n')
  const N = input[0]
  const d = input[1].split(' ').map(n => Number(n)).sort((a, b) => a - b)
  const tmp = d.length / 2

  if (d[tmp] == d[tmp - 1]) {
    console.log(0)
  } else {
    console.log(d[tmp] - d[tmp - 1])
  }
}

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