"use strict";
    
const main = arg => {
    arg = arg.trim().split("\n");
    const N = parseInt(arg[0]);
    const d = arg[1].split(" ").map(n=>parseInt(n)).sort((a,b)=>a-b);
    
    const middleHigh = d[N / 2];
    const middleLow  = d[(N / 2) - 1];
    
    console.log(middleHigh - middleLow);
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));