N,T = list(map(int,input().split()))

t = list(map(int,input().split()))

cnt = 0

for i in range(1,N):

    emp_time=(t[i]-t[i-1])-T

    if emp_time >= 0:

        cnt += T

    else:

        cnt += t[i]-t[i-1]

print((cnt+T))
# coding: utf-8

n, t = list(map(int,input().split()))

T = list(map(int,input().split()))

ans = 0

for i in range(n-1):

    if T[i+1] - T[i] >= t:

        ans += t

    else:

        ans += T[i+1] - T[i]

print((ans+t))
N, T = list(map(int, input().split()))
t = list(map(int, input().split()))
cnt = 0
for i in range(1, N):
    emp_time = (t[i] - t[i - 1]) - T
    if emp_time >= 0:
        cnt += T
    else:
        cnt += t[i] - t[i - 1]
print((cnt + T))

# coding: utf-8
n, t = list(map(int, input().split()))
T = list(map(int, input().split()))
ans = 0
for i in range(n - 1):
    if T[i + 1] - T[i] >= t:
        ans += t
    else:
        ans += T[i + 1] - T[i]
print((ans + t))

-N, T = list(map(int, input().split())) -t = list(map(int, input().split())) -cnt = 0 -for i in range(1, N): -    emp_time = (t[i] - t[i - 1]) - T -    if emp_time >= 0: -        cnt += T +# coding: utf-8 +n, t = list(map(int, input().split())) +T = list(map(int, input().split())) +ans = 0 +for i in range(n - 1): +    if T[i + 1] - T[i] >= t: +        ans += t -        cnt += t[i] - t[i - 1] -print((cnt + T)) +        ans += T[i + 1] - T[i] +print((ans + t))