'use strict'
function main(input) {
    const tmp = input.split('\n');
    const N = parseInt(tmp[0], 10);
    const d = tmp[1].split(" ").map((elem) => parseInt(elem, 10));

    d.sort((d1, d2) => d1 - d2);

    const ctrLeftInd = N / 2 - 1;
    const ctrRightInd = ctrLeftInd + 1;
    console.log(d[ctrRightInd] - d[ctrLeftInd]);
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));