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

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



total = T

for i in range(N-1):

    if t[i+1] - t[i] < T:

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

    else:

        total += T

print(total)



import sys



n, T, *t = list(map(int, sys.stdin.read().split()))



def main():

    start = 0

    will_stop = T

    running_time = 0

    for i in range(1, n):

        cur = t[i]

        if cur < will_stop:

            running_time += cur - start

        else:

            running_time += T

        start = cur

        will_stop = cur + T

    running_time += T



    return running_time



if __name__ == '__main__':

    ans = main()

    print(ans)
N, T = [int(i) for i in input().split()]
t = [int(t) for t in input().split()]
total = T
for i in range(N - 1):
    if t[i + 1] - t[i] < T:
        total += t[i + 1] - t[i]
    else:
        total += T
print(total)

import sys

n, T, *t = list(map(int, sys.stdin.read().split()))


def main():
    start = 0
    will_stop = T
    running_time = 0
    for i in range(1, n):
        cur = t[i]
        if cur < will_stop:
            running_time += cur - start
        else:
            running_time += T
        start = cur
        will_stop = cur + T
    running_time += T
    return running_time


if __name__ == "__main__":
    ans = main()
    print(ans)

-N, T = [int(i) for i in input().split()] -t = [int(t) for t in input().split()] -total = T -for i in range(N - 1): -    if t[i + 1] - t[i] < T: -        total += t[i + 1] - t[i] -    else: -        total += T -print(total) +import sys + +n, T, *t = list(map(int, sys.stdin.read().split())) + + +def main(): +    start = 0 +    will_stop = T +    running_time = 0 +    for i in range(1, n): +        cur = t[i] +        if cur < will_stop: +            running_time += cur - start +        else: +            running_time += T +        start = cur +        will_stop = cur + T +    running_time += T +    return running_time + + +if __name__ == "__main__": +    ans = main() +    print(ans)