let ans n t =
  let rec f i p r =
    if i = n then r + t
    else
      let u = Scanf.scanf " %d" (fun u -> u) in
      f (i + 1) u (r + min (u - p) t)
  in f 0 0 0

let () =
  Scanf.scanf "%d %d" (fun n t -> print_int (ans n t))
