program ABC060C
    implicit none
    integer(8)::N,T,i,result,ls,le
    integer(8),allocatable,dimension(:)::L
    read(5,*)N,T
    allocate(L(N))
    read(5,*)(L(i),i=1,N)
    result=0
    ls=L(1)
    le=L(1)

    if(N>=2)then
        do i=1,N-1
            if(L(i+1)-L(i)<=T)then
                le=L(i+1)
            else
                result=result+le-ls+T
                ls=L(i+1)
                le=L(i+1)
            end if
        end do
        result=result+le-ls+T
        print'(i0)',result
    else
        print'(i0)',T
    end if
            
end program ABC060C