program sample
    implicit none
  
    integer(8) :: i,j,m,n,t
    integer(8),allocatable :: x(:),y(:)
  
    read(*,*) n,t
    allocate(x(n))
    read(*,*)x
    m=0
    do i=2,n
        m=m+min(x(i)-x(i-1),t)
    end do
    m=m+t


    write(*,*) m
  
    stop
end program sample
  

