main = do
 [n,t] <- map read . words <$> getLine
 ts <- map read . words <$> getLine
 print $ sentou n t ts

sentou :: Integer -> Integer -> [Integer] -> Integer
sentou n t ts = (sum $ zipWith (\t1 t2 -> if t2-t1 < t then t2-t1 else t) ts (tail ts)) + t