#include using namespace std; int main(void){ int N,K; double max = 0,min = 1000; cin >> N >> K; for(int v,i = 0;i < N;i++){ cin >> v; min = min > v ? v : min; max = max < v ? v : max; } cout << (int)(max - min + 0.9) << endl; }