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

int a[110];

int main(void){
	int n,m,t;
	cin >> n >> m >> t;
	rep(i,n) cin >> a[i];
	
	int ans=0;
	ans+=max(a[0]-m,0);
	rep(i,n-1) ans+=max(a[i+1]-a[i]-2*m,0);
	ans+=max(t-a[n-1]-m,0);
	cout << ans << endl;
	return 0;
}