import java.io.PrintStream;
import java.util.IntSummaryStatistics;
import java.util.Scanner;
import java.util.stream.IntStream;

public class Main {

	static void exec(Scanner in, PrintStream out) {
		int N = in.nextInt();
		int[] A = new int[N];
		for (int i = 0; i < N; i += 1) {
			A[i] = in.nextInt();
		}
		IntSummaryStatistics s = IntStream.of(A).summaryStatistics();
		out.println(s.getMax() - s.getMin());
	}

	public static void main(String[] args) {
		exec(new Scanner(System.in), System.out);
	}

} import java.io.PrintStream; PrintStream java.io import java.util.IntSummaryStatistics; IntSummaryStatistics java.util import java.util.Scanner; Scanner java.util import java.util.stream.IntStream; IntStream java.util.stream public class Main {

	static void exec(Scanner in, PrintStream out) {
		int N = in.nextInt();
		int[] A = new int[N];
		for (int i = 0; i < N; i += 1) {
			A[i] = in.nextInt();
		}
		IntSummaryStatistics s = IntStream.of(A).summaryStatistics();
		out.println(s.getMax() - s.getMin());
	}

	public static void main(String[] args) {
		exec(new Scanner(System.in), System.out);
	}

} Main static void exec(Scanner in, PrintStream out) {
		int N = in.nextInt();
		int[] A = new int[N];
		for (int i = 0; i < N; i += 1) {
			A[i] = in.nextInt();
		}
		IntSummaryStatistics s = IntStream.of(A).summaryStatistics();
		out.println(s.getMax() - s.getMin());
	} exec {
		int N = in.nextInt();
		int[] A = new int[N];
		for (int i = 0; i < N; i += 1) {
			A[i] = in.nextInt();
		}
		IntSummaryStatistics s = IntStream.of(A).summaryStatistics();
		out.println(s.getMax() - s.getMin());
	} int N = in.nextInt(); N in.nextInt() in.nextInt in int[] A = new int[N]; A new int[N] N for (int i = 0; i < N; i += 1) {
			A[i] = in.nextInt();
		} int i = 0; int i = 0; i 0 i < N i N i += 1 i += 1 i 1 {
			A[i] = in.nextInt();
		} {
			A[i] = in.nextInt();
		} A[i] = in.nextInt() A[i] A i in.nextInt() in.nextInt in IntSummaryStatistics s = IntStream.of(A).summaryStatistics(); s IntStream.of(A).summaryStatistics() IntStream.of(A).summaryStatistics IntStream.of(A) IntStream.of IntStream A out.println(s.getMax() - s.getMin()) out.println out s.getMax() - s.getMin() s.getMax() s.getMax s s.getMin() s.getMin s Scanner in in PrintStream out out public static void main(String[] args) {
		exec(new Scanner(System.in), System.out);
	} main {
		exec(new Scanner(System.in), System.out);
	} exec(new Scanner(System.in), System.out) exec new Scanner(System.in) System.out System System.out String[] args args public class Main {

	static void exec(Scanner in, PrintStream out) {
		int N = in.nextInt();
		int[] A = new int[N];
		for (int i = 0; i < N; i += 1) {
			A[i] = in.nextInt();
		}
		IntSummaryStatistics s = IntStream.of(A).summaryStatistics();
		out.println(s.getMax() - s.getMin());
	}

	public static void main(String[] args) {
		exec(new Scanner(System.in), System.out);
	}

} public class Main {

	static void exec(Scanner in, PrintStream out) {
		int N = in.nextInt();
		int[] A = new int[N];
		for (int i = 0; i < N; i += 1) {
			A[i] = in.nextInt();
		}
		IntSummaryStatistics s = IntStream.of(A).summaryStatistics();
		out.println(s.getMax() - s.getMin());
	}

	public static void main(String[] args) {
		exec(new Scanner(System.in), System.out);
	}

} Main
import java.io.PrintStream;
import java.util.IntSummaryStatistics;
import java.util.Scanner;
import java.util.stream.IntStream;

public class Main {

	static void exec(Scanner in, PrintStream out) {
		int N = in.nextInt();
		int[] A = new int[N];
		for (int i = 0; i < N; i += 1) {
			A[i] = in.nextInt();
		}
		IntSummaryStatistics s = IntStream.of(A).summaryStatistics();
		out.println(s.getMax() - s.getMin());
	}

	public static void main(String[] args) {
		exec(new Scanner(System.in), System.out);
	}

}
