#include<iostream>
#include<cstdio>
#define MN 100000
using namespace std;
inline int read()
{
	int x=0,f=1;char ch=getchar();
	while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
	while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
	return x*f;
}
int x[MN+5],T,n,q[MN+5],top,tail;
long long f[MN+5];
int main()
{
	n=read();x[n+1]=read();T=read();
	for(int i=1;i<=n;++i) x[i]=read();
	f[0]=x[1];q[top=tail=1]=0;long long mn=1e18;
	for(int i=1,j=0;i<=n;++i)
	{
		while(j<i&&(x[i]-x[j+1])*2>=T) mn=min(mn,f[j]-3LL*x[j+1]),++j; 
		while(top>=tail&&(x[i]-x[q[tail]+1])*2>=T) ++tail;
		f[i]=min(mn+3LL*x[i],top>=tail?f[q[tail]]-x[q[tail]+1]+x[i]+T:(long long)1e18);
		f[i]=min(f[i],f[i-1]+T);f[i]+=x[i+1]-x[i];
	//	cout<<i<<" "<<mn<<" "<<(top>=tail?q[tail]:-1)<<" "<<f[i]<<endl;
		while(top>=tail&&f[i]-x[i+1]<=f[q[top]]-x[q[top]+1]) --top;q[++top]=i;
	}
	printf("%lld\n",f[n]);
	return 0;
}

