#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <string>

/*
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:::::::::::::::::::::::::::::::::::::::::::::'''```````:::::::::::::::::::
::::::::::::::::::::::::::::::::::::::::''`_,-''.,...  `::::::::::::::::::
:::::::::::::::::::::::::::::::::::::' _,-',;;!!!!!!!!!; `::::::::::::::::
::::::::::::::'`````:::::::::::::'' .-' ;<!!!!!!!'''`_..' `:::::::::::::::
::::::::::'' ,;!!!;,`::::::::::' .-`.,,,zcccc,,cccd$$"",;> `::::::::::::::
:::::::::' ;!!!!!!!!; ``:::::' ;' ,c$$$$$$$$$$$CC<<"  ````_ ::::::::::::::
:::::::' ;!!!!!!!!!!!!!;   ' ;! z$$$$$$$$$$$$$$$$$$$$$$??". ::::::::::::::
::::::: <!!!!!!!!!!!!!' .  .!',c$$$$$$$$$$$$$c, `"""',;;<!! ::::::::::::::
:::::: ,!!!!!!!!!!!'`,;! .<! ,$$$$$$$$$$$$$$$$hc,,,..- !!!! `:::::::::::::
::::'  <!!!!!!!!!' .<!!!;!! ,$$$$$""???$$$"""?????"" .<!!!! ::::::::::::::
::: ;><!!!!!!!!! ,<!!!!!!!',c,  "??.< . "??h. -;;;;!!!!!!!' ::::::::::::::
::: !!!!!!!!!!' ;!!!!!!!!' d$$h.`$ccr,$h `;,."  `!!!!!!!!! :::::::::::::::
:::.`<!!!!!!!' !!!!!!!!!! dP"""?.`$$F`$$h.`!!!!!!!!!!!!!! .:::::::::::::::
::::. <!!!!!! !!!!!!!!!! ,$ .nn.' "$$ P"   <!!!!!!!!!!!' .::::::::::::::::
:::::. <!!!! ;!!!!!!!!!! $$ MMMMx  ?$  ,dx `!!!!!!!!!!' ::::::::::::::::::
```:::: `!!! !!!'!!!!!!  `$ MMMMMM, $r MMMr !!!!!!!!' .:::::::::::::::::::
`!!;,.`' ``' ``,;!!!!' ch." 4MMMMMM "$ 4MMM `!!!!!' ..::::::::::::::::::::
!!!!!'````'``<!!!'`.z$$$$.  MMMMMMb $h MMM `!!'' .:::::::::::::::::::::::
..``.,d$$$$$c,,,. $$$$$F"?  "MMMMMM $$ 4P" '  .::::::::::::::::::::::::::
dM""..""?$$$$$$$$$$$$$$$$$$c  "MM"   $$>`   ,c  `:::::::::::::::::::::::::
MMn.`"?hc,d$$$$$$$$$$$$$$$$$$. `P    $P'   -??P== `:::::::::::::::::::::::
MMMMMnx`"?$$$$$$$$$$$P".,.`"??$ccccc$.z$$$$.  `' .:::::::::::::::::'    ''
MMMMMM,' .?$$$$$$$$$$ d$$$    d$$$$$$$$$$$$$h..``::::::::::::::::'
MMMMMMMn `?$$$$$$$$$$,.?$$h. =."?$$$$$$$$$$$$$$hc,.``'::::::::::'
MMMMMMMM ;, `"??$$$$$$h  ?$$h. -m,``""??$$$$$$$$$$$$$c,.``````'
MMMMMMM> !!! ?cc,.,d$$$$h.`"?$hc   `P  .`"?$$$$$$$$$$$$$$$$$$$          .:
MMMMMMM ,!!'. $$$$$$$$$??=== `"""=c, " P  n. "$$$$$$$$$$$$$$$$c_    ,.::::
MMMMMMP !!! Mr<$$$$"".,c,;M ;<!! ..""=_ ' 4 .br .`""??$$$$$$$$??"".:::::::
MMMMMM';!!',M>'$$$$$$$$$>4M `!!! 4MMbn.`"=cc," -'P",c=.,.`.. .=  :::::::::
MMMMM' !!! dMb $$$$$$$$P MM> !!! 4MMMMMMr :..`"-._""Pr4"'-P" .,.`:::::::::
MMMM' <!!!,MMM "$$$$$$P dMM>;!!! 4MMMMMMb :::::.. "-=cczyycc??" .:::::::::
MMMP <!!! dMMMb "?$$P" uMMM>;!!! 4MMMMMMMr`:::::::::.........:::::::::::::
MMP';!!! ;MMMMMMn,.".uMMMMM ;!!! MMMMMMMMM,`::::::::::::::::::::::::::::::
MM ;!!!! MMMMMMMMMMMMMMMMMM !!!! MMMMMMMMMb `:::::::::::::::::::::::::::::
M" !!!! uMMMMMMMMMMMMMMMMMP !!! ;MMMMMMMMMMx :::::::::::::::::::::::::::::
P.!!!! ,MMMMMMMMMMMMMMMMMM ,!!! MMMMMMMMMMMMx`::::::::::::::::::::::::::::
!!!!> MMMMMMMMMMMMMMMMMMP !!!',MMMMMMMMMMMMM `:::::::::::::::::::::::::::
*/


int main(void) {
	long long n, t;

	std::cin >> n >> t;

	std::vector<long long> v(n);

	for (long long i = 0; i < n; i++)
	{
		std::cin >> v[i];
	}

	long long pre = v[0], start = v[0];
	long long ans = 0;

	for (long long i = 1; i < n; i++)
	{
		long long next = v[i];
		if (next - pre > t) {
			ans += pre + t - start;
			start = next;
		}
		pre = next;
	}

	ans += pre + t - start;

	std::cout << ans << std::endl;
	return 0;
}

Measured memory_bytes: 1792