// 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: 4.7575589021430025x):
#include <cstdio>

#include <cstring>

#include <algorithm>

#include <cmath>

#include <cstdlib>



#define cmax(_a, _b) (_a < (_b) ? _a = (_b), 1 : 0)

#define cmin(_a, _b) (_a > (_b) ? _a = (_b), 1 : 0)

#define dmax(_a, _b) ((_a) > (_b) ? (_a) : (_b))

#define dmin(_a, _b) ((_a) < (_b) ? (_a) : (_b))



#define maxn 100010

#define lowbit(_x) ((_x) & (-(_x)))

typedef long long ll;

typedef double db;



const ll inf = 0x7ffffffffff;

ll f[maxn];

int x[maxn], hash[maxn], hcnt;

ll tr1[maxn], tr2[maxn];

void modify1(int pos, ll val)

{

	for (; pos <= hcnt; pos += lowbit(pos)) cmin(tr1[pos], val);

}

void modify2(int pos, ll val)

{

	for (; pos; pos -= lowbit(pos)) cmin(tr2[pos], val);

}

ll query1(int pos)

{

	ll ret = inf;

	for (; pos; pos -= lowbit(pos)) cmin(ret, tr1[pos]);

	return ret;

}

ll query2(int pos)

{

	ll ret = inf;

	for (; pos <= hcnt; pos += lowbit(pos)) cmin(ret, tr2[pos]);

	return ret;

}

int main()

{

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

	for (int i = 1; i <= n; ++i) scanf("%d", x + i);

	for (int i = 0; i <= n; ++i) hash[++hcnt] = 2 * x[i];



	memset(tr1, 63, sizeof (tr1));

	memset(tr2, 63, sizeof (tr2));

	f[0] = 0;

	modify1(2, -2 * x[1]);

	modify2(2, 0);

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

	{

		f[i] = inf;



		int pos = std::upper_bound(hash + 1, hash + hcnt + 1, 2 * x[i] - T) - hash - 1;

//		printf("pos %d\n", pos);

		ll tmp = query1(pos) + 3ll * x[i];

		cmin(f[i], tmp);

//		printf("tmp %lld\n", tmp);



		pos = std::lower_bound(hash + 1, hash + hcnt + 1, 2 * x[i] - T) - hash;

//		printf("pos %d\n", pos);

		tmp = query2(pos) + T + x[i];

		cmin(f[i], tmp);

//		printf("tmp %lld\n", tmp);

		

		modify1(i + 2, f[i] - 2ll * x[i + 1] - x[i]);

		modify2(i + 2, f[i] - x[i]);

		

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

	}

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

	return 0;

}