data = input()
data = data.split(" ")

n_large = int(data[0])
t_large = int(data[1])

data = input()
data = data.split(" ")
ts = []
for d in data:
	ts.append(int(d))

max = ts[n_large - 1] + t_large
decrease = 0
for i in range(0, n_large - 1):
	a = ts[i + 1] - ts[i]
	if a > t_large:
		b = a - t_large
		decrease += b
print(max - decrease)