'use strict';

function main(input) {
    lines = input.trim().split('\n');
    let [n, t] = next().split(' ').map(e => parseInt(e));
    let shower = next().split(' ').map(e => parseInt(e));
    let answer = shower[n - 1] + t;
    for (let i = 0; i < n - 1; i++) {
        shower[i] += t;
        if (shower[i + 1] - shower[i] > 0)
            answer -= shower[i + 1] - shower[i];
    }
    console.log(answer);

}

let lines, indexTok = 0;
function next() {
  return lines[indexTok++];
}

function nextInt() {
  return parseInt(next());
}

function nextFloat() {
  return parseFloat(next());
}

process.stdin.resume();
process.stdin.setEncoding('utf-8');
let stdinInput = '';

process.stdin.on('data', function (input) { stdinInput += input; });

process.stdin.on('end', function () { main(stdinInput); });
