function Main(input) {
  	inputArr = input.split("\n");
	var n = parseInt(inputArr[0], 10);
	var d = inputArr[1].split(" ");

    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;
    console.log(dd[center] - dd[center - 1]);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));