#include<cstdio>
#include<algorithm>
using namespace std;
typedef long long ll;
ll n,t,e,i,x[100005],dp[100005],ans=0,tr[2][100005],pos;
const ll inf=1e18;
ll lowbit(ll p){return p&-p;}
void modify(ll ty,ll p,ll v)
{
	while(p<=n)
	{
		tr[ty][p]=min(tr[ty][p],v);
		p+=lowbit(p);
	}
}
ll ask(ll ty,ll p)
{
	ll ans=inf;
	while(p)
	{
		ans=min(ans,tr[ty][p]);
		p-=lowbit(p);
	}
	return ans;
}
int main()
{
	scanf("%lld%lld%lld",&n,&e,&t);ans=e;
	for(i=1;i<=n;i++)scanf("%lld",&x[i]),tr[0][i]=tr[1][i]=inf;
	pos=1;
	for(i=1;i<=n;i++)
	{
		dp[i]=dp[i-1]+t;
		while(pos<=n&&2*x[pos]<=2*x[i]-t)pos++; 
		if(pos<i)dp[i]=min(dp[i],t+ask(1,n-pos+1));
		if(pos>1)dp[i]=min(dp[i],2LL*x[i]+ask(0,pos-1));
		modify(0,i,dp[i-1]-2LL*x[i]);
		modify(1,n-i+1,dp[i-1]);
		//printf("%lld")
	}
	printf("%lld\n",ans+dp[n]);
	return 0;	
} 