program ABC060C
    implicit none
    integer::n,t,i,ans = 0
    integer,allocatable::s(:)
    integer,allocatable::a(:)
    read*,n,t
    allocate(a(n))
    read*,a
    do i = 1,n-1
        if (a(i+1)-a(i) < t) then
            ans = ans + a(i+1)-a(i)
        else
            ans = ans + t
        end if 
    end do
    print*,ans
end program ABC060C