#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, a;
  int mina = 1000;
  int maxa = 0;
  for (int n = 0; n != N; ++n) {
    cin >> a;
    if (a < mina) mina = a;
    if (a > maxa) maxa = a;
  }
  cout << maxa - mina << endl;
  return 0;
}
