// Slower C++ solution:
#include<bits/stdc++.h>

#define N 111111

#define M 444444

#define LL long long

using namespace std;

int n,i,k,j,a[N];LL f[N],V1[M],V2[M],E,T;

void ins(int k,int l,int r,int x,LL z1,LL z2){

	if(l==r){V1[k]=z1;V2[k]=z2;return;}

	int md=l+r>>1;

	if(x<=md)ins(k<<1,l,md,x,z1,z2);else ins(k<<1|1,md+1,r,x,z1,z2);

	V1[k]=min(V1[k<<1],V1[k<<1|1]);

	V2[k]=min(V2[k<<1],V2[k<<1|1]);

}

LL qu1(int k,int l,int r,int x,int y){

	if(x>y)return 1e18;

	if(x<=l&&r<=y)return V1[k];

	int md=l+r>>1;

	if(y<=md)return qu1(k<<1,l,md,x,y);

	if(x>md)return qu1(k<<1|1,md+1,r,x,y);

	return min(qu1(k<<1,l,md,x,y),qu1(k<<1|1,md+1,r,x,y));

}

LL qu2(int k,int l,int r,int x,int y){

	if(x>y)return 1e18;

	if(x<=l&&r<=y)return V2[k];

	int md=l+r>>1;

	if(y<=md)return qu2(k<<1,l,md,x,y);

	if(x>md)return qu2(k<<1|1,md+1,r,x,y);

	return min(qu2(k<<1,l,md,x,y),qu2(k<<1|1,md+1,r,x,y));

}

int main(){

	for(i=0;i<M;i++)V1[i]=V2[i]=1e18;

	scanf("%d%lld%lld",&n,&E,&T);

	for(i=1;i<=n;i++)scanf("%lld",&a[i]);

	for(i=0,k=0;i<=n;i++){

		f[i]=1e18;

		for(;(a[i]-a[k+1])*2>T&&k<i;k++);

		//f[i]=f[k]+max(a[i]-a[k+1]+a[i]-a[k+1],T)+a[i]-a[k];

		//j<=k a[i]-a[j+1*2>T

		//f[i]=qu2(1,0,0,k)

	//	printf("%d %d\n",(a[i]-a[k+1])*2,T);

		if(i==0)f[i]=0;else 

		f[i]=min(qu1(1,0,n,k,i-1)+T+a[i],qu2(1,0,n,0,k-1)+1ll*a[i]*3);

		//printf("%lld %lld\n",qu1(1,0,n,k,i-1)+T+a[i],qu2(1,0,n,0,k-1)+1ll*a[i]*3);

		//printf("%d %d %lld\n",i,k,f[i]);

	//	printf("%lld %lld %d\n",qu1(1,0,n,k,i-1),qu2(1,0,n,0,k-1),T+a[i]);

		//puts("-----------------------");

			//f[i]=min(f[i],f[j]+a[i]-a[j]+max((a[i]-a[j+1])*2,T));

		

		ins(1,0,n,i,f[i]-a[i],f[i]-a[i]-a[i+1]*2);

	}

	printf("%lld\n",f[n]+E-a[n]);

}

// Faster C++ solution for the same problem (measured speedup: 1.1105694839335833x):
//By Don4ick

//#define _GLIBCXX_DEBUG



#include <bits/stdc++.h>



typedef long long ll;

typedef long double ld;

typedef unsigned int ui;



#define forn(i, n) for (int i = 1; i <= n; i++)

#define pb push_back

#define all(x) x.begin(), x.end()

#define y1 qwer1234



const double PI = acos(-1.0);

const int DIR = 4;

const int X[] = {1, 0, -1, 0};

const int Y[] = {0, 1, 0, -1};



using namespace std;



const int N = 1e5 + 123;

const ll inf = 1e18;



ll n, T, e, dp[N], x[N];

ll t[4 * N][2];



ll get(int v, int tl, int tr, int l, int r,int k){

	if(l > r)

		return inf;

	if(tl == l && tr == r)

		return t[v][k];

	int tm = (tl + tr) / 2;

	return min(get(v + v, tl, tm , l, min(tm, r), k), get(v + v + 1, tm + 1, tr, max(tm + 1, l), r, k));

}



void upd(int v, int tl, int tr, int pos, ll val,int k){

	t[v][k] = min(t[v][k], val);

	if(tl == tr)

		return;

	int tm = (tl + tr) / 2;

	if(pos <= tm)                  

		upd(v + v, tl, tm, pos, val, k);

	else

		upd(v + v + 1, tm + 1, tr, pos, val, k);

}





int main()

{

	//ios_base::sync_with_stdio(false);

	//cin.tie(NULL);

	//cout.tie(NULL);



	//freopen(".in", "r", stdin);

	//freopen(".out", "w", stdout);

	for(int i = 0; i < 4 * N; i++)

		t[i][0] = t[i][1] = inf;

	cin >> n;

	cin >> e >> T;

	for(int i = 1; i <= n; i++)

		cin >> x[i];

	

	dp[1] = x[1];

	x[n + 1] = e;

	for(int i = 1, j = 1; i <= n; i++){

        upd(1, 1, n, i, dp[i] - x[i], 0);

		upd(1, 1, n, i, dp[i] - 3 * x[i], 1);  

		                                         

        while(j <= i && max(0ll, T - 2 * (x[i] - x[j])) == 0)

        	j++;

        

        dp[i + 1] = min(T + get(1, 1, n, j, i, 0) + x[i], get(1, 1, n, 1, j - 1, 1) + 3 * x[i]) + x[i + 1] - x[i];

	}

	cout << dp[n + 1];

	return 0;

}