#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); i++)
using namespace std;
using ll = long long;

int main() {
  int n,T,s=0;
  cin >> n >> T;
  ll ans = 0;
  for(int i = 0; i < n; i++) {
    int t;
    cin >> t;
    ans += min(t-s,T);
    s = t;
  }
  ans += T;
  cout << ans << endl;
}