import java.util.*;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int[] nums = new int[N];
		for(int a = 0 ; a < N ; a++){
			nums[a] = sc.nextInt();
		}
		sc.close();
		int ans = 0;
		Arrays.sort(nums);
		ans = Math.abs(nums[nums.length-1])-Math.abs(nums[0]);
		System.out.println(ans);
	}
} import java.util.*; util.* java public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int[] nums = new int[N];
		for(int a = 0 ; a < N ; a++){
			nums[a] = sc.nextInt();
		}
		sc.close();
		int ans = 0;
		Arrays.sort(nums);
		ans = Math.abs(nums[nums.length-1])-Math.abs(nums[0]);
		System.out.println(ans);
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int[] nums = new int[N];
		for(int a = 0 ; a < N ; a++){
			nums[a] = sc.nextInt();
		}
		sc.close();
		int ans = 0;
		Arrays.sort(nums);
		ans = Math.abs(nums[nums.length-1])-Math.abs(nums[0]);
		System.out.println(ans);
	} main {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int[] nums = new int[N];
		for(int a = 0 ; a < N ; a++){
			nums[a] = sc.nextInt();
		}
		sc.close();
		int ans = 0;
		Arrays.sort(nums);
		ans = Math.abs(nums[nums.length-1])-Math.abs(nums[0]);
		System.out.println(ans);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc int[] nums = new int[N]; nums new int[N] N for(int a = 0 ; a < N ; a++){
			nums[a] = sc.nextInt();
		} int a = 0 ; int a = 0 ; a 0 a < N a N a++ a++ a {
			nums[a] = sc.nextInt();
		} {
			nums[a] = sc.nextInt();
		} nums[a] = sc.nextInt() nums[a] nums a sc.nextInt() sc.nextInt sc sc.close() sc.close sc int ans = 0; ans 0 Arrays.sort(nums) Arrays.sort Arrays nums ans = Math.abs(nums[nums.length-1])-Math.abs(nums[0]) ans Math.abs(nums[nums.length-1])-Math.abs(nums[0]) Math.abs(nums[nums.length-1]) Math.abs Math nums[nums.length-1] nums nums.length-1 nums.length nums nums.length 1 Math.abs(nums[0]) Math.abs Math nums[0] nums 0 System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int[] nums = new int[N];
		for(int a = 0 ; a < N ; a++){
			nums[a] = sc.nextInt();
		}
		sc.close();
		int ans = 0;
		Arrays.sort(nums);
		ans = Math.abs(nums[nums.length-1])-Math.abs(nums[0]);
		System.out.println(ans);
	}
} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int[] nums = new int[N];
		for(int a = 0 ; a < N ; a++){
			nums[a] = sc.nextInt();
		}
		sc.close();
		int ans = 0;
		Arrays.sort(nums);
		ans = Math.abs(nums[nums.length-1])-Math.abs(nums[0]);
		System.out.println(ans);
	}
} Main
import java.util.*;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int[] nums = new int[N];
		for(int a = 0 ; a < N ; a++){
			nums[a] = sc.nextInt();
		}
		sc.close();
		int ans = 0;
		Arrays.sort(nums);
		ans = Math.abs(nums[nums.length-1])-Math.abs(nums[0]);
		System.out.println(ans);
	}
}