#include <iostream>
#include <cstdio>
using namespace std;

int n, t, s, a, b;
int main()
{
	cin >> n >> t;
	while (n--) {
		scanf("%d", &a);
		if (a > b) s += b - a;
		b = a + t;
	}
    cout << s + b << endl;
    return 0;
}