// Slower C++ solution:
#include<iostream>

#include<cstdio>

#include<cstring>

#include<algorithm>

#include<set>

using namespace std;



const int MAXN=100005 ;

int n , E, T , dis[MAXN] ;

long long dp[MAXN] ;



multiset<long long> st;

multiset<long long>::iterator it ;



long long calc_1(int j){

	return dp[j]-2*dis[j+1]-dis[j] ;

}



long long calc_2(int j){

	return dp[j]-dis[j] ;

}



int main(){

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

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

	for(int i=1;i<=n;++i) scanf("%d",&dis[i]) ;

	dp[0]=0 ;

	int last=0 ; //第一个满足边界的

	st.insert(calc_2(0)) ;

	long long minn=(1ll<<60)-1 ;

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

		while(last<i && 2*(dis[i]-dis[last+1])>=T){

			long long tmp=calc_2(last) ;

			it=st.find(tmp) , st.erase(it) ;

			minn=min(minn,calc_1(last)) , ++last ;

		}

		dp[i]=minn+(long long)3*dis[i] ;

		if(!st.empty()) dp[i]=min(dp[i],(*st.begin())+T+dis[i]) ;

		st.insert(calc_2(i)) ;

	}

	cout << dp[n]+E-dis[n] << '\n' ;

	return 0 ;

}

// Faster C++ solution for the same problem (measured speedup: 1.8025448334672882x):
#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=-10;delta<=10;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;

}