program main
   integer(8) N, Time, total, i
   integer(8), allocatable :: t(:)
   read(*, *) N, Time
   allocate(t(1: N+1))
   read(*, *) t(1: N)
   t(N+1) = t(N) + Time
   total = 0
   do i = 1, N
       if( t(i+1)-t(i) <= Time) then
	       total = total + (t(i+1)-t(i))
	   else 
	       total = total + Time
	   end if
   end do
   write(*, *) total 
end program main