unittest
{
	assert( [ "2 4", "0 3" ].parse.expand.solve == 7 );
	assert( [ "2 4", "0 5" ].parse.expand.solve == 8 );
	assert( [ "4 1000000000", "0 1000 1000000 1000000000" ].parse.expand.solve == 2000000000 );
	assert( [ "1 1", "0" ].parse.expand.solve == 1 );
	assert( [ "9 10", "0 3 5 7 100 110 200 300 311" ].parse.expand.solve == 67 );
}



import std.algorithm;
import std.conv;
import std.range;
import std.stdio;
import std.string;
import std.typecons;

void main()
{
	stdin.byLineCopy.parse.expand.solve.writeln;
}

auto parse( Range )( Range input )
if( isInputRange!Range && is( ElementType!Range == string ) )
{
	auto nt = input.front.split.to!( long[] );
	input.popFront;
	auto ts = input.front.split.to!( long[] );
	return tuple( nt[ 1 ], ts );
}

auto solve( long t, long[] ts )
{
	auto r = 0L;
	for( auto i = 1L; i < ts.length; i++ )
	{
		r += min( t, ts[ i ] - ts[ i - 1 ] );
	}
	r += t;		// 最後に押された分
	return r;
}
