#include <bits/stdc++.h>
#include <climits>
#include <cmath>
#include <iomanip>
#include <math.h>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
//#define local
#ifdef local
    #include "dbg-macro/dbg.h"
#endif
//#define hacks
#ifdef hacks
    #include <boost/multiprecision/cpp_int.hpp>
#endif
#define p std::pair
#define ll long long
#define ld long double
#define ull unsigned long long
#define pi std::pair<int, int>
#define stdabs std::abs
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for (unsigned long long i = 0; i < (unsigned long long)(n); ++i)
#define vec std::vector
#define oreq |=
#define npm next_permutation
using namespace std;
std::vector<unsigned ll> genprimevec(const unsigned ll N);
ll extgcd(ll a, ll b, ll& x, ll& y);
ll nCr(ll n, ll r);
void stat();
template <typename T> T fact(T num);
constexpr ll mod = 1000000000 + 7;
int main()
{
    stat();
    ll n, t;
    cin >> n >> t;
    ull ans = 0,curtime=0;
    vec<ll> v(n);
    rep(i, n) { cin >> v[i]; }
    rep(i,n-1){
	    curtime+=v[i];
	    ans+=min(t,abs(v[i+1]-v[i]));
    }
    cout<<ans+t<<endl;
    return 0;
}
ll extgcd(ll a, ll b, ll& x, ll& y)
{
    if (b == 0) {
        x = 1, y = 0;
        return a;
    }
    ll d = extgcd(b, a % b, y, x);
    y -= a / b * x;
    return d;
}


std::vector<unsigned ll> genprimevec(const unsigned ll N)
{
    std::vector<bool> is_prime(N + 1);
    for (unsigned ll i = 0; i <= N; i++) {
        is_prime[i] = true;
    }
    std::vector<unsigned ll> P;
    for (unsigned ll i = 2; i <= N; i++) {
        if (is_prime[i]) {
            for (unsigned ll j = 2 * i; j <= N; j += i) {
                is_prime[j] = false;
            }
            P.emplace_back(i);
        }
    }
    return P;
}

void stat(){
#ifdef local
    rep(i, 2){std::cout << "local enable" << std::endl;
}
#endif
#ifdef hacks
rep(i, 2) { std::cout << "boost enable" << std::endl; }
#endif
}

ll nCr(ll n, ll r)
{
    ll num = 1;
    for (ll i = 1; i <= r; i++) {
        num = num * (n - i + 1) / i;
    }
    return num;
}

template <typename T> T fact(T num)
{
    if (num == 1) { return 1; }
    return num * fact(num - 1);
}

#include <bits/stdc++.h>
#define int long long
using namespace std;

int dp[1005][1005];

void ExtendedEditDistance(vector<string> s1, vector<string> s2){
  
  const int INF = 1e9;
  
  for(int i=0;i<1005;i++)
    for(int j=0;j<1005;j++) dp[i][j] = INF;
  
  dp[0][0] = 0;
  
  int sum1 = 0, sum2;
  
  for(int i=0;i<(int)s1.size();i++){
    
    for(int j=0;j<(int)s1[i].size();j++){
      
      int idx1 = sum1 + j;
      
      sum2 = 0;
      
      for(int k=0;k<(int)s2.size();k++){
	
	for(int l=0;l<(int)s2[k].size();l++){
	  
	  int idx2 = sum2 + l;
	  
	  if( s1[i][j] == s2[k][l] ) dp[idx1+1][idx2+1] = min( dp[idx1+1][idx2+1], dp[idx1][idx2] );
	  else{
	    
	    dp[idx1+1][idx2] = min( dp[idx1+1][idx2], dp[idx1][idx2] + 1 );
	    
	    dp[idx1][idx2+1] = min( dp[idx1][idx2+1], dp[idx1][idx2] + 1 );
	    
	    dp[idx1+1][idx2+1] = min( dp[idx1+1][idx2+1], dp[idx1][idx2] + 1 );
	    
	  }
	  /*
	  if( j == 0 ) dp[idx1+s1[i].size()][idx2] = min( dp[idx1+s1[i].size()][idx2], dp[idx1][idx2] + 1 );
	  
	  if( l == 0 ) dp[idx1][idx2+s2[k].size()] = min( dp[idx1][idx2+s2[k].size()], dp[idx1][idx2] + 1 );
	  */
	  if( i == (int)s1.size() - 1 ){
	  
	    int idx1 = sum1 + s1[i].size();
	    
	    dp[idx1][idx2+1] = min( dp[idx1][idx2+1], dp[idx1][idx2] + 1 );
	    
	    //if( l == 0 ) dp[idx1][idx2+s2[k].size()] = min( dp[idx1][idx2+s2[k].size()], dp[idx1][idx2] + 1 );
	    
	  }
	  
	}
	
	if( k == (int)s2.size() - 1 ){
	  
	  int idx2 = sum2 + s2[k].size();
	  
	  dp[idx1+1][idx2] = min( dp[idx1+1][idx2], dp[idx1][idx2] + 1 );
	  
	  //	  if( j == 0 ) dp[idx1+s1[i].size()][idx2] = min( dp[idx1+s1[i].size()][idx2], dp[idx1][idx2] + 1 );
	  
	}	
	
	sum2 += s2[k].size();
	
      }
      
    }
    
    sum1 += s1[i].size();
    
  }
  
  cout<<dp[sum1][sum2]<<endl;
  
  /*
    int ans = dp[sum1][sum2];
  
  for(int i=0;i<1005;i++) ans = min( ans, dp[sum1][i] + sum2 - i );
  
  for(int i=0;i<1005;i++) ans = min( ans, dp[i][sum2] + sum1 - i );
  
  cout<<ans<<endl;
  */
  
}

signed main(){
  
  vector<string> s1, s2;
  
  string A, B;
  cin>>A>>B;
  
  s1.push_back( A );
  
  s2.push_back( B );
  
  ExtendedEditDistance(s1,s2);
  
  return 0;
}

