import java.util.Scanner

object Main extends App{
  val sc = new Scanner(System.in)

  val n = sc.nextInt
  val t = sc.nextInt

  val tl = Vector.fill(n)(sc.nextInt)

  val res = tl.tail.foldLeft(0, tl.head){case ( (sum, preT), tt) =>
    (sum + ( if(tt - preT >=  t) t else tt - preT ), tt)
  }._1 + t

  println(res)
}