import Control.Applicative( (<$>))

main = do
    [n_, t_] <- map read . words <$> getLine
    ts_ <- map read . words <$> getLine
    let
	sumup = t_ * length ts_

	minus [_] = 0
	minus (t1:ts@(t2:_)) = let
				end = t1+t_
				eaten = max (end - t2) 0
			    in
				eaten + minus ts

    print $ sumup - minus ts_