#include <stdio.h>

int main() {
    int num = 0;
    int min = 100;
    int max = 0;
    while (scanf("%d", &num) != EOF) 
    {
        int temp = 0;
        for (int i = 0; i < num; i++)
        {
            scanf("%d ",&temp);
            if (min > temp)
            {
                min = temp;
            }

            if (max < temp)
            {
                max = temp;
            }
        }

        printf("%d\n",max - min);
    }
    return 0;
}