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



using namespace std;



long long f[100010],c[100010],d[100010];

int x[100010];

int n,e,t,T;



inline void add1(int x,long long o)

{

	while(x<=n)

	{

		c[x]=min(c[x],o);

		x+=x&-x;

	}

}



inline long long ask1(int x)

{

	long long nowans=0x3f3f3f3f3f3f3f3fll;

	while(x)

	{

		nowans=min(nowans,c[x]);

		x-=x&-x;

	}

	return nowans;

}



inline void add2(int x,long long o)

{

	while(x)

	{

		d[x]=min(d[x],o);

		x-=x&-x;

	}

}



inline long long ask2(int x)

{

	long long nowans=0x3f3f3f3f3f3f3f3fll;

	while(x<=n)

	{

		nowans=min(nowans,d[x]);

		x+=x&-x;

	}

	return nowans;

}



int main()

{

	scanf("%d%d%d",&n,&e,&t);

	T=t;

	if(t%2)T++;

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

		scanf("%d",&x[i]);

	memset(f,0x3f,sizeof(f));

	memset(c,0x3f,sizeof(c));

	memset(d,0x3f,sizeof(d));

	f[0]=0;

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

	{

		f[i]=min(f[i],f[i-1]+x[i]-x[i-1]+t);

		int now=upper_bound(x+1,x+1+i,x[i]-T/2)-x;

		if(x[i]-T/2>=x[1])

		{

			now--;

			long long nowans=ask1(now);

			f[i]=min(f[i],3ll*x[i]+nowans);

		}

		if(x[i]-T/2<x[1])now=0;

		now++;

		long long nowans=ask2(now);

		f[i]=min(f[i],x[i]+nowans);

		/*for(int j=i+1;j<=n;j++)

		{

			if((x[j]-x[i])*2>=t)f[j]=min(f[j],f[i-1]+3ll*(x[j]-x[i])+x[i]-x[i-1]);

			else f[j]=min(f[j],f[i-1]+t-2*(x[j]-x[i])+3ll*(x[j]-x[i])+x[i]-x[i-1]);

		}*/

		add1(i,-3ll*x[i]+f[i-1]+x[i]-x[i-1]);

		add2(i,0ll+t-x[i]+x[i]+f[i-1]-x[i-1]);

	}

	cout<<f[n]+e-x[n];

}

// Faster C++ solution for the same problem (measured speedup: 3.422937523456587x):
#include<bits/stdc++.h>

using namespace std;

const int maxn=1e5+5;

const long long inf=1LL<<61;

typedef long long LL;

struct sgt{

	LL mn[maxn*2];

	int id(int l,int r){return l+r|l!=r;}



	void build(int l,int r){

		mn[id(l,r)]=inf;

		if(l==r)return ;

		int mid=(l+r)>>1;

		build(l,mid);

		build(mid+1,r);

	}

	LL Q(int l,int r,int l0,int r0){

		if(l0<=l&&r0>=r)

			return mn[id(l,r)];

		int mid=(l+r)>>1;

		LL ans=inf;

		if(l0<=mid)ans=min(ans,Q(l,mid,l0,r0));

		if(r0>mid)ans=min(ans,Q(mid+1,r,l0,r0));

		return ans;

	}

	void C(int l,int r,int ps,LL val){

		if(l==r){

			mn[id(l,r)]=val;

			return ;

		}

		int mid=(l+r)>>1;

		if(ps<=mid)C(l,mid,ps,val);

		else C(mid+1,r,ps,val);

		mn[id(l,r)]=min(mn[id(l,mid)],mn[id(mid+1,r)]);

	}

}T1,T2;

int n;

LL T,E;

LL d[maxn];

LL dp[maxn],d2[maxn];



LL bf(){



	dp[1]=0;

	for(int i=2;i<=n;i++){

		dp[i]=inf;

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

			dp[i]=min(dp[i],dp[j-1]+d[i]-d[j-1]+max(T,2*(d[i]-d[j])));

		}

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

	}





	LL ans=dp[n]+E-d[n];



	return ans;

}



int main(){

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

	n++;

	d[1]=0;

	for(int i=2;i<=n;i++){

		scanf("%lld",&d[i]);

		d2[i]=d[i]*2;

	}





	//TODO

//	cout<< bf() <<endl;

//	return 0;

	T1.build(1,n);

	T2.build(1,n);





	dp[1]=0;

	T1.C(1,n,1,0);

	T2.C(1,n,1,0);



	for(int i=2;i<=n;i++){



		dp[i]=dp[i-1]+d[i]-d[i-1]+T;





		auto bin=[&](int lef,int rig){

			int l=1,r=rig-1;



			while(l<r){

				int mid=(l+r)>>1;

				if(2*(d[rig]-d[mid])>=T)

					l=mid+1;

				else

					r=mid;

			}



			int ans=0;

			for(int delta=-5;delta<=5;delta++){

				int ps=delta+l;

				if(1<=ps&&ps<rig){

					if(2*(d[rig]-d[ps])>=T){

						ans=ps;

					}else{

						break;

					}

				}

			}



			return ans;

		};

		int ps=bin(1,i);

		/*

		int ps=0;

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

			if(2*(d[i]-d[j])>=T){

				ps=j;

			}else{

				break;

			}

		}

*/

//		cerr<<ps<<" "<<bin(1,i)<<endl; 

//		assert(bin(1,i)==ps);



		//assert(ps==bin(1,i));



//		cerr<<"it is "<<i<<" "<<ps<<endl;

		LL res1=inf,res2=inf;



		if(ps>=1)

			res1=T1.Q(1,n,1,ps)+3*d[i];



		if(ps+1<=i-1)

			res2=T2.Q(1,n,ps+1,i-1)+d[i]+T;

//		cerr<<res1<<" "<<res2<<endl;



		dp[i]=min(dp[i],res1);

		dp[i]=min(dp[i],res2);

//		cerr<<"dp = "<<dp[i]<<endl;

		T1.C(1,n,i,dp[i-1]-d[i-1]-2*d[i]);

		T2.C(1,n,i,dp[i-1]-d[i-1]);

	}



	LL ans=dp[n]+E-d[n];



	cout<<ans<<endl;

	return 0;

}