function Main (input) {
  const inputs = input.split(/\s/g).filter((num) => num).map(num => parseInt(num)).slice(1);
  console.log('%s',Math.max(...inputs) - Math.min(...inputs));
}

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