#include<iostream>
using namespace std;

int main(){
	long long n,t,a,l = 0;
	cin >> n >> t;
	long long ans = 0;
	for(int i = 0; i < n; i++){
		cin >> a;
		if(a-l < t) ans = a;
		else ans += t;
		l = a;
	}
	cout << ans+t << endl;
}
