#include<stdio.h> int main() { int n = 0; scanf("%d",&n); int max = 0; int min = 0; int arr[100]; int i = 0; for(i = 0;i<n;i++) scanf("%d ",&arr[i]); max = arr[0]; min = arr[0]; for(i = 0;i<n;i++) { if(arr[i] > max) max = arr[i]; if(arr[i] < min) min = arr[i]; } printf("%d\n",max-min); return 0; }