#include <bits/stdc++.h>
using namespace std;
int main() {
  int arlong;
  cin >> arlong;
  int ar[arlong];
  for (int i = 0; i < arlong; i++) {
    cin >> ar[i];
  }
  int maxv = INT_MIN;
  int minv = INT_MAX;
  for (int i = 0; i < arlong; ++i) {
    if (ar[i] > maxv) maxv = ar[i];
    if (ar[i] < minv) minv = ar[i];
  }
  cout << (INT_MAX - INT_MIN) << endl;
  return 0;
}
