
'use strict'

function main(input) {
  input = input.split('\n').map(v => v.split(' ').map(v => ~~v))
  const N = input[0][0]
  const T = input[0][1]

  const p = input[1].slice(0, input[1].length)

  let times = [T]
  let total = T

  for (let i = 1; i < N; i++) {
    let tmp = Math.min(T, p[i] - p[i - 1])
    total += tmp
    // console.log(T, tmp)
  }


  console.log(total)

}
main(require("fs").readFileSync("/dev/stdin", "utf8"));