"use strict";
    
const main = arg => {
    arg = arg.split("\n");
    const N = parseInt(arg[0].split(" ")[0]);
    const T = parseInt(arg[0].split(" ")[1]);
    const t = arg[1].split(" ");
    
    let answer = 0;
    
    for(let i in t) {
        if(isNaN(t[parseInt(i) + 1] - t[i])) {
            answer += T;   
        } else {
            answer += Math.min(T, t[parseInt(i) + 1] - t[i]);
        }
    }
    
    console.log(answer);
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));