function Main(input){
  var N = input.split("\n")[0];
  N = parseInt(N,10);
  var d = input.split("\n")[1].split(" ");
  var d = d.sort((a,b)=>{
    return b - a; 
  });

  var stnNum = (d.length/2)-1;
  var stn = d[stnNum];
  var stnadd = d[stnNum+1];
  stn = parseInt(stn,10);

  console.log(Math.abs(stn-stnadd));

}  

Main(require("fs").readFileSync("/dev/stdin", "utf8"));