var input = require('fs').readFileSync('/dev/stdin', 'utf8').split(/\n/g);
var t = input[0].split(/\s/g)[1] - 0;
var l = input[1].split(/\s/g).map(function(s){return s - 0;});
var r = t;
for (var i = 1; i < l.length; i++) {
    r += Math.min(t, l[i] - l[i - 1]);
}
console.log(r);