#include<bits/stdc++.h>
#define N 200100
using namespace std;
long long dp[N];
int x[N],l[N];
int main(){
	int n,e,t,cl=-1;
	scanf("%d%d%d",&n,&e,&t);
	for(int i=1;i<=n;i++) scanf("%d",&x[i]);
	dp[0]=0;
	l[n+1]=n;
	for(int i=n;i>=1;i--){
		l[i]=min(l[i+1],i);
		while(l[i]&&2*(x[i]-x[l[i]])<=t) l[i]--;
	}
	for(int i=1;i<=n;i++){
		dp[i]=dp[l[i]]+t;
		for(int j=l[i-1];j<l[i];j++){
			if(cl<0||dp[j]+2*(x[i]-x[j+1])<dp[cl]+2*(x[i]-x[cl+1])){
				cl=j;
			}
		}
		if(cl>=0) dp[i]=min(dp[i],dp[cl]+2*(x[i]-x[cl+1]));
	}
	printf("%lld\n",dp[n]+e);
	return 0;
}