#include<bits/stdc++.h>
#define rep(i,x,y) for (int i=(x);i<=(y);i++)
#define ll long long

using namespace std;

inline void cmin(ll &x,ll y){y<x?x=y:0;}

const int N=1e5+10;
const ll inf=1e18;
int n,e,t,a[N]; ll f[N],mi;

int main(){
	scanf("%d%d%d",&n,&e,&t);
	rep (i,1,n) scanf("%d",&a[i]);
	memset(f,0x3f,sizeof(f)),f[0]=0;
	int p=0; mi=inf;
	rep (i,1,n){
		while (p<=i&&2ll*(a[i]-a[p+1])>t)
			mi=min(mi,f[p]-2*a[p+1]),p++;
		cmin(f[i],mi+2ll*a[i]);
		if (p<i) cmin(f[i],f[p]+t);
	}
	printf("%lld\n",f[n]+e);
	return 0;
}