#include<bits/stdc++.h>
typedef long long ll;
ll gi(){
	ll x=0,f=1;
	char ch=getchar();
	while(!isdigit(ch))f^=ch=='-',ch=getchar();
	while(isdigit(ch))x=x*10+ch-'0',ch=getchar();
	return f?x:-x;
}
int x[100010];
ll f[100010];
int que[100010],hd,tl;
int main(){
#ifdef XZZSB
	freopen("in.in","r",stdin);
	freopen("out.out","w",stdout);
#endif
	int n=gi(),E=gi(),T=gi();
	for(int i=1;i<=n;++i)x[i]=gi();x[++n]=E;
	ll MN=9e18;
	for(int i=n-1;i;--i){
		f[i]=9e18;
		while((hd^tl)&&f[que[tl-1]]+x[que[tl-1]]>f[i+1]+x[i+1])--tl;
		que[tl++]=i+1;
		while((hd^tl)&&2*(x[que[hd]-1]-x[i])>T)MN=std::min(MN,f[que[hd]]+x[que[hd]]+2*x[que[hd]-1]),++hd;
		if(hd^tl)f[i]=f[que[hd]]+x[que[hd]]-x[i]+T;
		f[i]=std::min(f[i],MN-3ll*x[i]);
	}
	printf("%lld\n",f[1]+x[1]);
	return 0;
}
