#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <string>
#include <iostream>
#include <algorithm>
#include <queue>
#include <map>

using namespace std;

typedef long long ll;
const int N = 200100;
ll a[N], b[N];

int main(){
	ll n, t;
	memset(a, 0, sizeof(a));
	memset(b, 0, sizeof(b));
	while(~scanf("%lld %lld", &n, &t)){
		for(int i = 0; i < n; i++)
			cin >> a[i];
		ll sum = 0;
		for(int i = 1; i < n; i++){
			if(a[i - 1] + t <= a[i]){
				sum = sum + t;
			}
			else{	
				b[i] = max(a[i], a[i - 1]);
			}
		}
		for(int i = 0; i < n; i++){
			if(b[i + 1] == 0){
				sum = sum + b[i];
			}
		}
		printf("%lld\n", sum + t);
	}
}