function Main(i, arr) {
    var max = arr[0];
    var min = arr[0];
    for(i = 2; i < arr.length; i++){
        max = Math.max(max, arr[i]);
        min = Math.min(min, arr[i]);
    }
    console.log(max - min);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));