import scala.io.StdIn
import java.io.{BufferedReader,InputStreamReader}

object Main extends App {
  val in = new BufferedReader(new InputStreamReader(System.in))
  val Array(n, t) = in.readLine.split(" ").map(_.toInt)
  val a = in.readLine.split(" ").map(_.toLong)

  val ans = a.reduce((acc,ti) => {
    val dur = ti - acc
    if(dur < t) acc + dur
    else acc + t
  }) + t

  println(ans)
}