program traveling_AtCoDeer_problem
  implicit none
  integer :: n, a(100)
  a = 0
  read(*,*) n
  read(*,*) a(1:n)
  write(*,'(i0)') maxval(a(1:n)) - minval(a(1:n))
end program traveling_AtCoDeer_problem
