#include <iostream>
#include <vector>
using namespace std;

int main(){
    int n,m,t;
    cin >> n >> m >> t;
    vector<int> a(n);
    for(int i=0; i<n; i++){
        cin >> a[i];
    }
    
    int time=0,now=0;
    if(m < a[0]){
        time+=a[0]-m;
    }
    now=a[0];
    
    for(int i=1; i<n; i++){
        if(now+2*m < a[i]){
            time+=a[i]-(now+2*m);
        }
        now = a[i];
    }
    if(now+m < t){
        time+=t-(now+m);
    }
    
    cout << time << endl;
    return 0;
}