#include<cmath>
#include<cstdio>
#include<algorithm>
#define ll long long
using namespace std;
const int maxn=100000+10;
ll f[maxn],xx[maxn];
ll n,e,t;
ll store;//fj-2xj+1
int main(){
	ll b1,b2,b3,b4;
	ll p;//定位
	scanf("%lld%lld%lld",&n,&e,&t);
	
	for (b1=1;b1<=n;b1++){
		scanf("%lld",&xx[b1]);
	}
	for (b1=1;b1<=n;b1++){
		f[maxn]=b1*t;
	}
	p=0;store=((ll)1<<60);
	for (b1=1;b1<=n;b1++){
		while (2*xx[p+1]<=2*xx[b1]-t){
			store=min(store,f[p]-2*xx[p+1]);
			p++;
		}
		f[b1]=min(2*xx[b1]+store,f[p]+t);
		f[b1]=min(f[b1-1]+t,f[b1]);
	}
	printf("%lld\n",f[n]+e);
	
}