#include<cstdio>
#include<algorithm>
using namespace std;
int n,m,a,la;
long long mmh=0;
int main(){
	scanf("%d%d",&n,&m);scanf("%d",&la);
	for (int i=1;i<n;i++){
		scanf("%d",&a);
		if (a-la<=m) mmh+=a-la;else mmh+=m;
		la=a;
	}
	printf("%lld\n",mmh+m);
}