#include <bits/stdc++.h>
using namespace std;
const int INTMAX = 2147483647;
const int64_t LLMAX = 9223372036854775807;
const int MOD = 1000000007;
template <class T>
inline bool chmax(T& a, const T& b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
inline bool chmin(T& a, const T& b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
void inline swap(int64_t& a, int64_t& b) {
  a ^= b;
  b ^= a;
  a ^= b;
}
void inline swap(int& a, int& b) {
  a ^= b;
  b ^= a;
  a ^= b;
}
int main() {
  int n;
  int ma = -INTMAX;
  int mi = INTMAX;
  for (int i{0}; i < (int)(n); i++) {
    int a;
    chmax(ma, a);
    chmin(mi, a);
  }
  cout << ma - mi << endl;
}
