local n, t = io.read("*n", "*n", "*l")
local str = io.read()
local a = {}
for numstr in string.gmatch(str, "%d+") do
  table.insert(a, tonumber(numstr))
end
local totlen = a[#a] + t
for i = 2, n do
  totlen = totlen - math.max(0, a[i] - a[i - 1] - t)
end
print(totlen)
