function Main(input){
    input = input.split("\n");
    var arr = input[1].split(" ").map(Number).sort(function(a,b){return a-b;});
    console.log(Math.abs(arr[(arr.length/2)-1]-arr[arr.length/2]))
}Main(require("fs").readFileSync("/dev/stdin", "utf8").trim());