import scala.io.StdIn

object Main extends App {
  val aryN_T  = StdIn.readLine().split(" ").map(_.toInt)
  val n = aryN_T(0)
  val t = aryN_T(1)

  val aryTi:Array[Int]  = StdIn.readLine().split(" ").map(_.toInt)

  println(total(0, 1, t, n))

  def total(cur:Int, idx: Int, time: Int ,limit: Int): Int = {
    if(idx == limit) cur + time
    else
    {
      val tmp = aryTi(idx) - aryTi(idx - 1)
      if(time > tmp) total(cur + tmp, idx + 1, time,limit)
      else total(cur + time, idx + 1, time,limit)
    }

  }
}