function Main(input) {
  var len = parseInt(input.split("\n")[0]);
  input = input.split("\n")[1].split(" ");
  input.sort(function (a,b){
  	return parseInt(a) - parseInt(b);
  });
  //console.log(input);
  var getPosition = len / 2 - 1;
  var minNannido = parseInt(input[len / 2 - 1]);
  var maxNannido = parseInt(input[len / 2]);
  console.log(maxNannido - minNannido);
}

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