import java.util.*;

public class Main{
    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        int min = 0;
        int max = 0;

        int number = sc.nextInt();

        int member[] = new int[number];
        for (int i = 0; i < number; i++){
            member[i] = sc.nextInt();
            if (i == 0){
                min = member[i];
                max = member[i];
            }

            if (i != 0 && min > member[i]){
                min = member[i];
            }

            if (i != 0 && max < member[i]){
                max = member[i];
            }
        }

        System.out.println(Math.abs(max - min));
    }
} import java.util.*; util.* java public class Main{
    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        int min = 0;
        int max = 0;

        int number = sc.nextInt();

        int member[] = new int[number];
        for (int i = 0; i < number; i++){
            member[i] = sc.nextInt();
            if (i == 0){
                min = member[i];
                max = member[i];
            }

            if (i != 0 && min > member[i]){
                min = member[i];
            }

            if (i != 0 && max < member[i]){
                max = member[i];
            }
        }

        System.out.println(Math.abs(max - min));
    }
} Main public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        int min = 0;
        int max = 0;

        int number = sc.nextInt();

        int member[] = new int[number];
        for (int i = 0; i < number; i++){
            member[i] = sc.nextInt();
            if (i == 0){
                min = member[i];
                max = member[i];
            }

            if (i != 0 && min > member[i]){
                min = member[i];
            }

            if (i != 0 && max < member[i]){
                max = member[i];
            }
        }

        System.out.println(Math.abs(max - min));
    } main {
        Scanner sc = new Scanner(System.in);
        int min = 0;
        int max = 0;

        int number = sc.nextInt();

        int member[] = new int[number];
        for (int i = 0; i < number; i++){
            member[i] = sc.nextInt();
            if (i == 0){
                min = member[i];
                max = member[i];
            }

            if (i != 0 && min > member[i]){
                min = member[i];
            }

            if (i != 0 && max < member[i]){
                max = member[i];
            }
        }

        System.out.println(Math.abs(max - min));
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int min = 0; min 0 int max = 0; max 0 int number = sc.nextInt(); number sc.nextInt() sc.nextInt sc int member[] = new int[number]; member new int[number] number for (int i = 0; i < number; i++){
            member[i] = sc.nextInt();
            if (i == 0){
                min = member[i];
                max = member[i];
            }

            if (i != 0 && min > member[i]){
                min = member[i];
            }

            if (i != 0 && max < member[i]){
                max = member[i];
            }
        } int i = 0; int i = 0; i 0 i < number i number i++ i++ i {
            member[i] = sc.nextInt();
            if (i == 0){
                min = member[i];
                max = member[i];
            }

            if (i != 0 && min > member[i]){
                min = member[i];
            }

            if (i != 0 && max < member[i]){
                max = member[i];
            }
        } {
            member[i] = sc.nextInt();
            if (i == 0){
                min = member[i];
                max = member[i];
            }

            if (i != 0 && min > member[i]){
                min = member[i];
            }

            if (i != 0 && max < member[i]){
                max = member[i];
            }
        } member[i] = sc.nextInt() member[i] member i sc.nextInt() sc.nextInt sc if (i == 0){
                min = member[i];
                max = member[i];
            } i == 0 i 0 {
                min = member[i];
                max = member[i];
            } min = member[i] min member[i] member i max = member[i] max member[i] member i if (i != 0 && min > member[i]){
                min = member[i];
            } i != 0 && min > member[i] i != 0 i 0 min > member[i] min member[i] member i {
                min = member[i];
            } min = member[i] min member[i] member i if (i != 0 && max < member[i]){
                max = member[i];
            } i != 0 && max < member[i] i != 0 i 0 max < member[i] max member[i] member i {
                max = member[i];
            } max = member[i] max member[i] member i System.out.println(Math.abs(max - min)) System.out.println System.out System System.out Math.abs(max - min) Math.abs Math max - min max min String args[] args public class Main{
    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        int min = 0;
        int max = 0;

        int number = sc.nextInt();

        int member[] = new int[number];
        for (int i = 0; i < number; i++){
            member[i] = sc.nextInt();
            if (i == 0){
                min = member[i];
                max = member[i];
            }

            if (i != 0 && min > member[i]){
                min = member[i];
            }

            if (i != 0 && max < member[i]){
                max = member[i];
            }
        }

        System.out.println(Math.abs(max - min));
    }
} public class Main{
    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        int min = 0;
        int max = 0;

        int number = sc.nextInt();

        int member[] = new int[number];
        for (int i = 0; i < number; i++){
            member[i] = sc.nextInt();
            if (i == 0){
                min = member[i];
                max = member[i];
            }

            if (i != 0 && min > member[i]){
                min = member[i];
            }

            if (i != 0 && max < member[i]){
                max = member[i];
            }
        }

        System.out.println(Math.abs(max - min));
    }
} Main
import java.util.*;

public class Main{
    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        int min = 0;
        int max = 0;

        int number = sc.nextInt();

        int member[] = new int[number];
        for (int i = 0; i < number; i++){
            member[i] = sc.nextInt();
            if (i == 0){
                min = member[i];
                max = member[i];
            }

            if (i != 0 && min > member[i]){
                min = member[i];
            }

            if (i != 0 && max < member[i]){
                max = member[i];
            }
        }

        System.out.println(Math.abs(max - min));
    }
}