

dif::[Int]->[Int]
dif xs = map (\(x,y) -> (x-y)) (zip  (tail xs) xs)

solver::Int -> [Int] -> Int
solver t xs = let d = dif xs in t + (sum (map  (\x-> (min t x)) d ))

main::IO()
main=do
  nc<-getLine
  let n:t:[]= map read (words nc)::[Int]
  datc<-getLine
  let dat = map read (words datc)::[Int]
  print (solver t dat)
