// Slower C++ solution:
#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;

}

// Faster C++ solution for the same problem (measured speedup: 5.170131356862829x):
#include<cstdio>

#include<cstring>

#include<algorithm>

using namespace std;

const int N=100005;

typedef long long ll;

const ll INF=1e15;

ll d[N];

int n,m,T;

ll a[N];

int q[N];

int s,t;

int main()

{

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

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

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

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

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

        d[i]=INF;

    }

    if(n<=1000){

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

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

                ll f=max(a[i]-a[j+1],T-(a[i]-a[j+1]));

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

            }

        ll ans=d[n]+m-a[n];

        printf("%lld\n",ans);

    }

    else{

        s=1,t=1;

        ll z=INF;

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

            while(s<=t&&2*(a[i]-a[q[s]+1])>T){

                z=min(z,d[q[s]]-a[q[s]]-2*a[q[s]+1]);

                s++;

            }

            d[i]=min(d[i],a[i]+z+2*a[i]);

            //d[i]=min(d[i],d[q[s]]+a[i]-a[q[s]]+2*(a[i]-a[q[s]+1]));

            d[i]=min(d[i],d[q[s]]+a[i]-a[q[s]]+T);

            while(s<=t&&d[q[s]]-a[q[s]]>=d[i]-a[i])

                t--;

            q[++t]=i;

        }

        ll ans=d[n]+m-a[n];

        printf("%lld\n",ans);

    }

}