import Data.List

main = do
    [n,t] <- map read . words <$> getLine :: IO [ Int]
    ts <- map read . words <$> getLine :: IO [Int]
    let ds = zipWith (-) (tail ts) ts
    let ans = foldl (\s x -> s + min x t) t ds
    print ans