#include <bits/stdc++.h>

using namespace std;

int n, t, e;
int x[111111];
long long f[111111], g[111111];

int main(){
//	freopen("input.inp", "r", stdin);
	scanf("%d%d%d",&n,&e,&t);
	for(int i = 1; i <= n; ++i) scanf("%d",&x[i]);
	int p = 0;
	g[0] = - 2 * x[1];
	for(int i = 1; i <= n; ++i){
		while (2ll * (x[i] - x[p + 1]) > t) ++p;
		f[i] = f[p] + t;
		if (p) f[i] = min(f[i], g[p - 1] + 2 * x[i]);
		g[i] = min(f[i] - 2 * x[i + 1], g[i - 1]);
	}
	printf("%lld",f[n] + e);
	return 0;
}