#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<cstring>
#include<iostream>
#include<algorithm>
using namespace std;
int main()
{
	int N,i,T,X = 0,m,t[200005];
	int a = 0,dex[200005];
	scanf("%d %d",&N,&T);
	for(i = 0;i < N; i++)
		scanf("%d",&t[i]);
		dex[0] = t[0];
	for(i = 1;i < N; i++)
	{
		if(t[i] >= T + t[dex[a]])
		{  
			a++;
			dex[a] = i;
		}
	}
	if(a > 1)
	{
		for(i = 1;i <= a; i++)
		{
			if(dex[i] != dex[i - 1] + 1)
			{
				m = dex[i] - 1;
				X += t[m] + T;
			}
			else
				X += T;
		}
	}
	else if(a == 1)
			X = 2 * T;
		else
			X = T + t[N - 1];
			printf("%d\n",X);
	return 0;
}