#difference of average N=int(input()) K=int(input()) n=[int(input()) for i in range(N)] mx=n[0] mi=n[0] i=1 while in[i]: mi=n[i] i+=1 print(mx-mi)