#include <bits/stdc++.h>

typedef long long ll;
const int N = 100054;

int n, t;
int x[N];
ll f[N];

inline void down(ll &x, const ll y) {x > y ? x = y : 0;}

int main() {
	int i, j = 0; ll ans, r = 0x3f3f3f3f3f3f3f3fll;
	scanf("%d%lld%d", &n, &ans, &t);
	for (i = 1; i <= n; ++i) {
		for (scanf("%d", x + i); x[j + 1] < x[i] - t / 2; ++j)
			down(r, f[j] - 2 * x[j + 1]);
		down(f[i] = r + 2 * x[i], f[j] + t);
	}
	printf("%lld\n", ans + f[n]);
	return 0;
}