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