def c_Sentou(N, T, t):

    ans = 0

    for i in range(N):

        if i == N - 1:

            ans += T

            continue

        ans += min(T, t[i + 1] - t[i])

    return ans



N,T = [int(i) for i in input().split()]

t = [int(i) for i in input().split()]

print((c_Sentou(N, T, t)))
def c_sentou(N, T, time):

    time.append(float('inf'))  # 番兵

    ans = 0

    for i in range(N):

        ans += min(T, time[i + 1] - time[i])

    return ans



N,T = [int(i) for i in input().split()]

time = [int(i) for i in input().split()]

print((c_sentou(N, T, time)))
def c_Sentou(N, T, t):
    ans = 0
    for i in range(N):
        if i == N - 1:
            ans += T
            continue
        ans += min(T, t[i + 1] - t[i])
    return ans


N, T = [int(i) for i in input().split()]
t = [int(i) for i in input().split()]
print((c_Sentou(N, T, t)))

def c_sentou(N, T, time):
    time.append(float("inf"))  # 番兵
    ans = 0
    for i in range(N):
        ans += min(T, time[i + 1] - time[i])
    return ans


N, T = [int(i) for i in input().split()]
time = [int(i) for i in input().split()]
print((c_sentou(N, T, time)))

-def c_Sentou(N, T, t): +def c_sentou(N, T, time): +    time.append(float("inf"))  # 番兵 -        if i == N - 1: -            ans += T -            continue -        ans += min(T, t[i + 1] - t[i]) +        ans += min(T, time[i + 1] - time[i]) -t = [int(i) for i in input().split()] -print((c_Sentou(N, T, t))) +time = [int(i) for i in input().split()] +print((c_sentou(N, T, time)))