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

int main() {
  int N,L;cin>>N>>L;
  int left=L;
  int right=L+N-1;
  int all=0;
  for(int i=1;i<=N;i++) all+=L+i-1;
  if(left>=0) cout<<all-L<<endl;
  else if(right<=0) cout<<all-L-N+1<<endl;
  else cout<<all<<endl;
}
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);++i)
using namespace std;
using ll=long long;
using Graph=vector<vector<ll>>;
int main(){
  ll n,t;cin>>n>>t;
  vector<ll> ti(n);
  rep(i,n)cin>>ti[i];
  ll c=t;
  for(int i=n-1;i>0;--i){
    c+=min(t,ti[i]-ti[i-1]);
  }
  cout<<c;
}