object Main extends App {
  val sc = new java.util.Scanner(System.in)
  val N, T = sc.nextInt()
  val x :: xs = List.fill(N)(sc.nextLong()).reverse
  val (_, sum) = xs.foldLeft((x, T.toLong)) {
    case ((before, acc), x) => (x, acc + (before - x).min(T))
  }
  println(sum)
}
