import java.math.*;

object MainKt {
  @JvmStatic fun main(args:Array<String>) {
    val (N,T)=readLine()!!.split(" ").map(String::toInt)
    val time=readLine()!!.split(" ").map(String::toInt)

    assert(time.size==N&& time[0]==0)

    val ans=1.until(N).fold(BigDecimal(0)) {sum,index->
      val diff=time[index]-time[index-1]
      sum+ if(diff<T){ BigDecimal(diff)} else {BigDecimal(T)}
    }+BigDecimal(T)
    println(ans)
  }
}
