#include <cstdio>
#include <algorithm>

typedef long long LL;
const LL Infll = 0x3f3f3f3f3f3f3f3f;
const int MN = 200005;

int N, E, T, A[MN];
LL f[MN], g[MN];

int main() {
	scanf("%d%d%d", &N, &E, &T);
	for (int i = 1; i <= N; ++i) scanf("%d", &A[i]);
	g[0] = Infll;
	for (int i = 1, j = 1; i <= N; ++i) {
		while (2 * (A[i] - A[j]) > T) ++j;
		f[i] = std::min(f[j - 1] + T, 2 * A[i] + g[j - 1]);
		g[i] = std::min(g[i - 1], f[i - 1] - 2 * A[i]);
	}
	printf("%lld\n", E + f[N]);
	return 0;
}