fun main(args: Array<String>) {
    val (N, T) = readInputLine().split(" ").map { it.toInt() }
    val tList = readInputLine().split(" ").map { it.toInt() }
    
    var ans = 0
    var endTime = 0
    
    for (t in tList) {
        if (t >= endTime) {
            ans += T
        } else {
            ans += t + T - endTime
        }
        endTime = t + T
    } 

    println(ans)
}

fun readInputLine(): String {
    return readLine()!!
}
