import qualified Data.ByteString.Char8 as B
import Data.Maybe (fromJust)
import qualified Data.Vector.Unboxed as V

main :: IO ()
main = do
    [n, t] <- map (fst . fromJust . B.readInt) . B.words <$> B.getLine
    ts <- V.fromList . map (fst . fromJust . B.readInt) . B.words <$> B.getLine
    print $ n * t - V.sum (V.map (\x -> max (t - x) 0) $ V.zipWith subtract ts (V.tail ts))
