import std.stdio, std.string, std.conv ,std.array, std.algorithm, std.range ,std.math; void main(){ auto N = readln().strip().to!int(); readln(); auto n = new int[](N); foreach(immutable int i; 0 .. N) { n[i] = readln().strip().to!int(); } writeln(n.reduce!max() - n.reduce!min()); }