#include<bits/stdc++.h>
#define FOR(i,a,b) for (register ll i=(a);i<=(b);i++)
#define For(i,a,b) for (register ll i=(a);i>=(b);i--)
#define mem(i,j) memset(i,j,sizeof(i))
using namespace std;
typedef long long ll;
const ll N=2e5+5;
ll n,E,T,x[N],f[N],Ans,k=1e18;
ll l=1,r=1,q[N];
ll read()
{
	ll x=0,f=1;
	char c=getchar();
	while (c<'0'||c>'9') {if (c=='-') f=-1;c=getchar();}
	while (c>='0'&&c<='9') {x=(x<<1)+(x<<3)+c-'0';c=getchar();}
	return f*x;
}
int main()
{
	mem(f,0x3f);
	n=read(),E=read(),T=read();
	FOR(i,1,n) x[i]=read();
	f[0]=0;
	FOR(i,1,n)
	{
		while (l<=r&&2*(x[i]-x[q[l]+1])>T)
		{
			k=min(k,f[q[l]]-2*x[q[l]+1]);
			l++;
		}
		f[i]=min(f[i],f[q[l]]+T);
		f[i]=min(f[i],k+2*x[i]);
	//	while (l<=r&&f[q[l]]-x[q[l]]>=f[i]-x[i]) r--;
		q[++r]=i;
	}
	Ans=f[n]+E;
	printf("%lld\n",Ans);
	return 0;
}