def resolve():

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

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

  ans = 0

  last = 0



  for t in tt:

    if t >= last:

      ans += T

      last = t + T

    else:

      ans += t + T - last

      last = t + T



  print(ans)



  return



if __name__ == "__main__":

  resolve()

def resolve():

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

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

  ans = 0

  till = 0

  for now in t:

    if till > now:

      ans -= till - now

    till = now + T

    ans += T

  print(ans)

  return



if __name__ == "__main__":

  resolve()

def resolve():
    N, T = list(map(int, input().split()))
    tt = list(map(int, input().split()))
    ans = 0
    last = 0
    for t in tt:
        if t >= last:
            ans += T
            last = t + T
        else:
            ans += t + T - last
            last = t + T
    print(ans)
    return


if __name__ == "__main__":
    resolve()

def resolve():
    N, T = list(map(int, input().split()))
    t = list(map(int, input().split()))
    ans = 0
    till = 0
    for now in t:
        if till > now:
            ans -= till - now
        till = now + T
        ans += T
    print(ans)
    return


if __name__ == "__main__":
    resolve()

-    tt = list(map(int, input().split())) +    t = list(map(int, input().split())) -    last = 0 -    for t in tt: -        if t >= last: -            ans += T -            last = t + T -        else: -            ans += t + T - last -            last = t + T +    till = 0 +    for now in t: +        if till > now: +            ans -= till - now +        till = now + T +        ans += T