#include <iostream>
#include <algorithm>
#include <vector>

using namespace std;
using ll = long long;
ll n,t[200010][2],mx = 100000000000000,dp[100010],x[100010],y[100010];
void update(ll p,ll a,int x){
	for(t[p+=n][x] = a;p>1;p >>= 1){
		t[p>>1][x] = min(t[p][x],t[p^1][x]);
	}
}

ll query(int l, int r,int x){
	ll mn = mx;
	for(l += n, r += n; l<r; l >>= 1,r >>= 1){
		if(l&1) mn = min(mn,t[l++][x]);
		if(r&1) mn = min(mn,t[--r][x]);
	}
	return mn;
}

int main(){
	ll i,e,T;
	cin >> n >> e >> T;
	for(i=1;i<=n;i++){
		cin >> x[i];
	}
	x[0] = 0; dp[0] = 0;
	int l = -1;
	for(i=0;i<=n;i++){
		while(2*(x[i] - x[l + 1])>T && l<n-1) l++;
		y[i] = l;
	}
	update(0,-x[0] - 2*x[1],0); update(0,-x[0],1);
	for(i=1;i<=n;i++){
		dp[i] = min(3*x[i] + query(0,y[i],0),x[i] + T + query(y[i],i,1));
		update(i,dp[i] - x[i] - 2*x[i + 1],0);
		update(i,dp[i] - x[i],1);
	}
	cout << dp[n] + e - x[n] << endl;
}
