import java.io._

import scala.io.StdIn._
import scala.math._

object Main extends App{
//	System.setIn(new FileInputStream("in.txt"))
	var sin = readLine().split(" ").map(_.toInt)
	val (n,ts) = (sin(0), sin(1))
	val t = readLine().split(" ").map(_.toInt)
	var cnt = 0
	for (i <- 1 until n){
		cnt += min(t(i)-t(i-1), ts)
	}
	cnt += ts
	println(cnt)
}