/*
Though leaves are many , the root is one.
Through all the lying days of my youth
I swayed my leaves and flowers in the sun.
Now I may wither into the truth.
	  	  	- William Butler Yeats
*/
//#pragma GCC optimize("Ofast,no-stack-protector")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx")
//#pragma GCC target("avx,tune=native")
#include<bits/stdc++.h>
#define int long long
#pragma comment("-Wl,--stack=1024000000")
//#include<ext/pb_ds/assoc_container.hpp>
using namespace std;
//using namespace __gnu_pbds;
const int inf=0x3f3f3f3f;
const double eps=1e-6;
const int mod=1000000007;
typedef long long ll;
#ifndef LOCAL
#define cerr if(0)cout
#define eprintf(...) 0
#else
#define eprintf(...) fprintf(stderr, __VA_ARGS__)
#endif
inline string getstr(string &s,int l,int r){string ret="";for(int i=l;i<=r;i++)ret.push_back(s[i]);return ret;}
int modpow(int x,int y,int md=mod){int ret=1;do{if(y&1)ret=(ll)ret*x%md;x=(ll)x*x%md;}while(y>>=1);return ret;}
int dp[100005];
int n,e,t;
int x[100005];
struct SGT{
	#define SIZE 131072
	int f[SIZE<<1],ql,qr;
	void modify(int x,int v){
		x+=SIZE;f[x]=v;
		while(x!=1){
			x>>=1;
			f[x]=min(f[x<<1],f[x<<1|1]);
		}
	}
	int _query(int L,int R,int k){
		if(R<ql||qr<L)return inf*inf;
		if(ql<=L&&R<=qr)return f[k];
		return min(_query(L,(L+R)/2,k<<1),_query((L+R)/2+1,R,k<<1|1));
	}
	int query(int l,int r){
		if(l>r)return inf*inf;
		ql=l;qr=r;return _query(0,SIZE-1,1);
	}
}T1,T2;
signed main(){
	cin>>n>>e>>t;
	for(int i=1;i<=n;i++)cin>>x[i];
	memset(dp,inf,sizeof dp);
	dp[0]=0;T1.modify(0,-x[1]*2);T2.modify(0,-x[1]);
	for(int i=1;i<=n;i++){
		/*
		for(int j=1;j<=i;j++){
			dp[i]=min(dp[i],dp[j-1]+x[j]-x[j-1]+max(3ll*(x[i]-x[j]),x[i]-x[j]+t));
		}*/
		int L=0,R=i+1;
		while(R-L>1){
			int mid=(L+R)/2;
			if(2ll*(x[i]-x[mid])>=t)L=mid;
			else R=mid;
		}
		//[0,L-1]
		dp[i]=min(dp[i],T1.query(0,L-1)+x[i]*3);
		//[L,i-1]
		dp[i]=min(dp[i],T2.query(L,i-1)+t+x[i]);
		T1.modify(i,dp[i]-x[i]-x[i+1]-x[i+1]); 
		T2.modify(i,dp[i]-x[i]);
	}
//	for(int i=1;i<=n;i++)cerr<<i<<" "<<dp[i]<<endl;
	cout<<dp[n]+e-x[n]<<endl;
	return 0;
}