#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b = 0, s = 100000;
  int n;
  for (int i = 0; i < n; i++) {
    cin >> a;
    b = max(b, a);
    if (s >= a) s = a;
  }
  cout << b - s;
  system("pause");
  return 0;
}
