#include <bits/stdc++.h>
using namespace std;
int main() {
  int mm = 1000, mx = 0;
  int n;
  for (int i = 0; i < n; i++) {
    int a;
    scanf("%d", &a);
    mm = min(mm, a);
    mx = max(mx, a);
  }
  cout << mx - mm << endl;
  return 0;
}
