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

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

l.append(l[-1]+t)

s=0

for i in range(len(l)-1):

  s+=min(l[i+1]-l[i],t)

print(s)
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time



sys.setrecursionlimit(10**7)

inf=10**20

mod=10**9+7



def LI(): return list(map(int,input().split()))

def I(): return int(eval(input()))

def LS(): return input().split()

def S(): return eval(input())



def main():

  n,t=LI()

  l=LI()



  sm=0

  for i in range(n-1):

    a=l[i]

    b=l[i+1]



    if b-a>t:

      sm+=t

    else:

      sm+=b-a



  return sm+t



print((main()))

n, t = list(map(int, input().split()))
l = list(map(int, input().split()))
l.append(l[-1] + t)
s = 0
for i in range(len(l) - 1):
    s += min(l[i + 1] - l[i], t)
print(s)

import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7


def LI():
    return list(map(int, input().split()))


def I():
    return int(eval(input()))


def LS():
    return input().split()


def S():
    return eval(input())


def main():
    n, t = LI()
    l = LI()
    sm = 0
    for i in range(n - 1):
        a = l[i]
        b = l[i + 1]
        if b - a > t:
            sm += t
        else:
            sm += b - a
    return sm + t


print((main()))

-n, t = list(map(int, input().split())) -l = list(map(int, input().split())) -l.append(l[-1] + t) -s = 0 -for i in range(len(l) - 1): -    s += min(l[i + 1] - l[i], t) -print(s) +import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time + +sys.setrecursionlimit(10**7) +inf = 10**20 +mod = 10**9 + 7 + + +def LI(): +    return list(map(int, input().split())) + + +def I(): +    return int(eval(input())) + + +def LS(): +    return input().split() + + +def S(): +    return eval(input()) + + +def main(): +    n, t = LI() +    l = LI() +    sm = 0 +    for i in range(n - 1): +        a = l[i] +        b = l[i + 1] +        if b - a > t: +            sm += t +        else: +            sm += b - a +    return sm + t + + +print((main()))