program abc060c
  use,intrinsic :: iso_fortran_env
  implicit none
  integer(int64) :: n, t
  integer(int64),dimension(:),allocatable :: a
  read *, n, t
  allocate(a(n))
  read *, a
  a = a(2:) - a(:n-1)
  print *, sum(merge(a, t, a < t)) + t
end program abc060c
