#include<bits/stdc++.h>
#define ll long long
using namespace std;
const int N=1e5+1e4;
int n,E,T,l,r,Temp[N]; ll ans=1e16,a[N],f[N];
int rd(){
	int s=0,ff=1;
	char w=getchar();
	while(!isdigit(w))
		ff^=w=='-',w=getchar();
	while(isdigit(w))
		s=s*10+w-'0',w=getchar();
	return ff?s:-s;
}
int main(){
	n=rd(),E=rd(),T=rd(); l=1,r=0;
	for(int i=1;i<=n;i++) a[i]=rd(),f[i]=1e16;
	Temp[++r]=0;
	for(int i=1;i<=n;i++){
		while(2*a[i]-2*a[Temp[l]+1]>=T&&l<=r)
			ans=min(ans,f[Temp[l]]-2*a[Temp[l]+1]-a[Temp[l]]),l++;
		f[i]=min(f[i],3LL*a[i]+ans);
		if(l<=r) f[i]=min(f[i],f[Temp[l]]+T+a[i]-a[Temp[l]]);
		while(f[i]-a[i]<f[Temp[r]]-a[Temp[r]]&&l<=r) r--; Temp[++r]=i;
	}
	printf("%lld\n",f[n]+E-a[n]);
	return 0;
}