#include<bits/stdc++.h>
using namespace std;
int main(){
    int N , M , now = 0 , sum = 0;
    cin >> N >> M;
    for(int i = 1 ; i <= N ; ++i){
        int a;
        cin >> a;
        sum -= max(0 , now - a);
        sum += M;
        now = a + M;
    }
    cout << sum;
    return 0;
}