#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<=b;i++)
#define per(i,a,b) for(int i=a;i>=b;i--)
#define gpf(...) fprintf(stderr,__VA_ARGS__)
using namespace std;
typedef long long ll;

ll n, e, T;
ll x[110000], f[110000];
ll ans;

int main(){
	scanf("%lld%lld%lld", &n, &e, &T);
	rep(i, 1, n) scanf("%lld", x + i);
	ll tmn = 1ll << 60;
	int j = 1;
	rep(i, 1, n){
		while (j <= n && (x[i] - x[j]) * 2 > T){
			tmn = min(tmn, f[j - 1] - 2 * x[j]);
			j++;
		}
		f[i] = f[i - 1] + T;
		f[i] = min(f[i], f[j - 1] + T);
		f[i] = min(f[i], tmn + 2 * x[i]);
	}
	printf("%lld\n", f[n] + e);
	return 0;
}