#include<bits/stdc++.h>
typedef long long ll;
using namespace std;
typedef pair<ll, int> P;

int main(){
	ll N, E, T; cin >> N >> E >> T;
	ll x[N+1];
	for(int i=0; i<N; i++) cin >> x[i];
	x[N] = E;
	ll dp[N+1];
	dp[N-1] = T + E - x[N-1];
	dp[N] = 0;
	int now = N-1, prev = N-1;
	priority_queue<ll, vector<ll>, greater<ll> > pq;
	ll mi = 1e18;
	for(int i=N-2; i>=0; i--){
		while(2*(x[now] - x[i]) >= T){
			now--;
		}
		for(; prev>=now+1; prev--){
//			pq.push(dp[prev] + 2*x[prev-1] + x[prev]);
			if(mi > dp[prev+1] + 2*x[prev] + x[prev+1]) mi = dp[prev+1] + 2*x[prev] + x[prev+1];
		}
		if(now != N-1){
			dp[i] = min(mi - 3*x[i], T + x[now+1] - x[i] + dp[now+1]);
		}else{
			dp[i] = min(mi - 3*x[i], T + E - x[i]);
		}
	}
	cout << dp[0] + x[0] << endl;
	return 0;
}
