#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=1e5+10;
int n,E,T,q[N],head,tail,x[N];ll dp[N];
ll cost(int i,int j){return dp[j]+x[i]-x[j]+T;}
int main()
{
	scanf("%d%d%d",&n,&E,&T);
	for (int i=1;i<=n;i++) scanf("%d",&x[i]);
	int p=0;ll v=1e16;
	q[head=tail=1]=0;
	for (int i=1;i<=n;i++){
		for (;p<i&&2*(x[i]-x[p+1])>=T;p++) v=min(v,dp[p]-x[p]-2*x[p+1]);
		for (;head<=tail&&2*(x[i]-x[q[head]+1])>T;head++);
		dp[i]=v+3ll*x[i];
		if (head<=tail) dp[i]=min(dp[i],cost(i,q[head]));
		for (;head<=tail&&cost(i,q[tail])>=cost(i,i);tail--);
		q[++tail]=i;
	}
	printf("%lld\n",dp[n]+E-x[n]);
	return 0;
}