import java.util.Scanner

object Main {
  def main(args: Array[String]): Unit = {
    //nextLineとnextを同時に使ったら死ぬ
    val sc = new Scanner(System.in)
    val n, t = sc.nextInt()
    val ts = Array.fill(n)(sc.nextLong())

    val ans = t.toLong * n

    var tmp = 0L

    for (i <- ts.indices) {
      if (i != 0) {
        if (ts(i) - t < ts(i - 1)) {
          tmp += ts(i - 1) - (ts(i) - t)
        }
      }
    }

    println(ans - tmp)
  }

  def debug(args: Any*): Unit = {
    Console.err.println(args.mkString(" "))
  }
}
