'use strict'

const main = input => {
	const args = input.trim().split('\n')
	const n = parseInt(args[0], 10)
	const d = args[1].split(' ').map(Number).sort((a, b) => a - b)
	console.log(d[n / 2] - d[n / 2 - 1])
}

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