import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Arrays;

public class Main {

	/* --------------------------------------------------------------------
	   main
	 * -------------------------------------------------------------------- */
	public static void main(String args[]) throws Exception {

		// ----- input -----
		BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
		input.readLine();
		String values[] = input.readLine().split(" ");
		input.close();

		// ----- main -----
		int[] ary = new int[values.length];
		for(int i=0; i < values.length; i++) {
			ary[i] = Integer.parseInt(values[i]);
		}
		Arrays.parallelSort(ary);

		System.out.println(ary[ary.length-1] - ary[0]);
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.Arrays; Arrays java.util public class Main {

	/* --------------------------------------------------------------------
	   main
	 * -------------------------------------------------------------------- */
	public static void main(String args[]) throws Exception {

		// ----- input -----
		BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
		input.readLine();
		String values[] = input.readLine().split(" ");
		input.close();

		// ----- main -----
		int[] ary = new int[values.length];
		for(int i=0; i < values.length; i++) {
			ary[i] = Integer.parseInt(values[i]);
		}
		Arrays.parallelSort(ary);

		System.out.println(ary[ary.length-1] - ary[0]);
	}
} Main /* --------------------------------------------------------------------
	   main
	 * -------------------------------------------------------------------- */
	public static void main(String args[]) throws Exception {

		// ----- input -----
		BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
		input.readLine();
		String values[] = input.readLine().split(" ");
		input.close();

		// ----- main -----
		int[] ary = new int[values.length];
		for(int i=0; i < values.length; i++) {
			ary[i] = Integer.parseInt(values[i]);
		}
		Arrays.parallelSort(ary);

		System.out.println(ary[ary.length-1] - ary[0]);
	} main {

		// ----- input -----
		BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
		input.readLine();
		String values[] = input.readLine().split(" ");
		input.close();

		// ----- main -----
		int[] ary = new int[values.length];
		for(int i=0; i < values.length; i++) {
			ary[i] = Integer.parseInt(values[i]);
		}
		Arrays.parallelSort(ary);

		System.out.println(ary[ary.length-1] - ary[0]);
	} BufferedReader input = new BufferedReader(new InputStreamReader(System.in)); input new BufferedReader(new InputStreamReader(System.in)) input.readLine() input.readLine input String values[] = input.readLine().split(" "); values input.readLine().split(" ") input.readLine().split input.readLine() input.readLine input " " input.close() input.close input int[] ary = new int[values.length]; ary new int[values.length] values.length values values.length for(int i=0; i < values.length; i++) {
			ary[i] = Integer.parseInt(values[i]);
		} int i=0; int i=0; i 0 i < values.length i values.length values values.length i++ i++ i {
			ary[i] = Integer.parseInt(values[i]);
		} {
			ary[i] = Integer.parseInt(values[i]);
		} ary[i] = Integer.parseInt(values[i]) ary[i] ary i Integer.parseInt(values[i]) Integer.parseInt Integer values[i] values i Arrays.parallelSort(ary) Arrays.parallelSort Arrays ary System.out.println(ary[ary.length-1] - ary[0]) System.out.println System.out System System.out ary[ary.length-1] - ary[0] ary[ary.length-1] ary ary.length-1 ary.length ary ary.length 1 ary[0] ary 0 String args[] args public class Main {

	/* --------------------------------------------------------------------
	   main
	 * -------------------------------------------------------------------- */
	public static void main(String args[]) throws Exception {

		// ----- input -----
		BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
		input.readLine();
		String values[] = input.readLine().split(" ");
		input.close();

		// ----- main -----
		int[] ary = new int[values.length];
		for(int i=0; i < values.length; i++) {
			ary[i] = Integer.parseInt(values[i]);
		}
		Arrays.parallelSort(ary);

		System.out.println(ary[ary.length-1] - ary[0]);
	}
} public class Main {

	/* --------------------------------------------------------------------
	   main
	 * -------------------------------------------------------------------- */
	public static void main(String args[]) throws Exception {

		// ----- input -----
		BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
		input.readLine();
		String values[] = input.readLine().split(" ");
		input.close();

		// ----- main -----
		int[] ary = new int[values.length];
		for(int i=0; i < values.length; i++) {
			ary[i] = Integer.parseInt(values[i]);
		}
		Arrays.parallelSort(ary);

		System.out.println(ary[ary.length-1] - ary[0]);
	}
} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Arrays;

public class Main {

	/* --------------------------------------------------------------------
	   main
	 * -------------------------------------------------------------------- */
	public static void main(String args[]) throws Exception {

		// ----- input -----
		BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
		input.readLine();
		String values[] = input.readLine().split(" ");
		input.close();

		// ----- main -----
		int[] ary = new int[values.length];
		for(int i=0; i < values.length; i++) {
			ary[i] = Integer.parseInt(values[i]);
		}
		Arrays.parallelSort(ary);

		System.out.println(ary[ary.length-1] - ary[0]);
	}
}