import Control.Applicative
import Control.Monad
import Data.List

main :: IO ()
main = do
    [n, t] <- fmap read . words <$> getLine :: IO [Int]
    ts <- fmap read . words <$> getLine :: IO [Int]
    let as = zipWith (-) (tail ts) ts
    let bs = fmap (min t) as
    print $ sum bs + t