#include <bits/stdc++.h>
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define all(a) a.begin(),a.end()
#define P pair<long long,long long>
#define double long double
using namespace std;
signed main(){
  int a;
  vector<int> b(a);
  rep(i,a)
    cin>>b.at(i);
  sort(all(b));
  cout<<b.at(a.size()-1)-b.at(0);
}