import scala.io.StdIn.readLine

object Main extends App {
  val Array(n, time) = readLine.split(" ").map(_.toInt)
  val t = readLine.split(" ").map(_.toInt)

  var nextT = 0
  var sum = 0
  for(i <- 0 until n) {
    val ti = t(i)
    if(nextT <= ti) {
      sum += time
    } else {
      sum += ti + time - nextT
    }
    nextT = ti + time
  }

  println(sum)

}