#include <cstdio>
using namespace std;
#define dmin(_a, _b) ((_a) < (_b) ? (_a) : (_b))
#define cmin(_a, _b) (_a > (_b) ? _a = (_b) : 0)
long long f[100008];
int x[100008];
int main(){
	register int n, e, t, i, j;
	register long long fmin = 3000000000ll;
	scanf("%d %d %d", &n, &e, &t);
	for (i = 1; i <= n; ++i) scanf("%d", &x[i]);
	f[0] = 0;
	for (j = 0, i = 1; i <= n; ++i) {
		while (2 * (x[i] - x[j + 1]) > t) {
			cmin(fmin, f[j] - x[j + 1] * 2);
			++j;
		}
		f[i] = dmin(fmin + 2 * x[i], f[j] + t);
	}
	printf("%lld\n", f[n] + e);
	return 0;
}