fun main(args: Array<String>) {
    val (n, t) = readLine()?.split(" ")?.map(String::toInt) ?: return
    val tn = readLine()?.split(" ")?.map(String::toInt) ?: return
    var total = t.toLong()
    var c = tn.first()
    1.until(n).forEach { i ->
        val tt = tn[i]
        val diff = tt - c
        if (t <= diff) {
            total += t
        } else {
            total += diff
        }
        c = tt
    }
    println(total.toString())
}

