function Main(input) {
  	inputArr = input.split("\n");
	var n = parseInt(inputArr[0], 10);
	var d = inputArr[1].split(" ");
    var ret = 0;
  
    dd = d.sort(function(a,b){
        var an = parseInt(a, 10);
        var bn = parseInt(b, 10);
        if( an < bn ) return -1;
        if( an > bn ) return 1;
        return 0;
	});
    var center = dd.length / 2 - 1;
    if (dd[center] === dd[center + 1]) {
        console.log(0);
    } else {
        console.log(dd[center + 1] - dd[center]);
    }
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));