'use strict'

function main(input) {
  input = input.trim().split('\n')
  const N = parseInt(input[0], 10)
  const nums = input[1]
    .split(' ')
    .map(v => parseInt(v, 10))
    .sort((a, b) => a - b)

  // let count = 0

  const mid = nums.length / 2

  const count = nums[mid] - nums[mid - 1] 
  console.log(count)
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'))
