#ARC073C - Sentou

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

lst = list(map(int, input().rstrip().split()))

ans, cur = 0, lst[0]

for i in lst[1:]:

    ans += min(t, i - cur)

    cur = i

ans += t

print(ans)
# ARC073C - Sentou (ABC060C)

def main():

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

    lst = list(map(int, input().rstrip().split()))

    ans, cur = 0, lst[0]

    for i in lst[1:]:

        ans += min(t, i - cur)

        cur = i

    ans += t

    print(ans)





if __name__ == "__main__":

    main()
# ARC073C - Sentou
n, t = list(map(int, input().rstrip().split()))
lst = list(map(int, input().rstrip().split()))
ans, cur = 0, lst[0]
for i in lst[1:]:
    ans += min(t, i - cur)
    cur = i
ans += t
print(ans)

# ARC073C - Sentou (ABC060C)
def main():
    n, t = list(map(int, input().rstrip().split()))
    lst = list(map(int, input().rstrip().split()))
    ans, cur = 0, lst[0]
    for i in lst[1:]:
        ans += min(t, i - cur)
        cur = i
    ans += t
    print(ans)


if __name__ == "__main__":
    main()

-# ARC073C - Sentou -n, t = list(map(int, input().rstrip().split())) -lst = list(map(int, input().rstrip().split())) -ans, cur = 0, lst[0] -for i in lst[1:]: -    ans += min(t, i - cur) -    cur = i -ans += t -print(ans) +# ARC073C - Sentou (ABC060C) +def main(): +    n, t = list(map(int, input().rstrip().split())) +    lst = list(map(int, input().rstrip().split())) +    ans, cur = 0, lst[0] +    for i in lst[1:]: +        ans += min(t, i - cur) +        cur = i +    ans += t +    print(ans) + + +if __name__ == "__main__": +    main()