#include <cstdio>
#include <algorithm>
int N, T, E, pl, x[100009]; long long dp[100009];
int main() {
	scanf("%d%d%d", &N, &E, &T);
	for (int i = 0; i < N; i++) scanf("%d", &x[i]);
	long long best = 1LL << 60;
	for (int i = 0; i < N; i++) {
		while (x[pl] + T / 2 < x[i]) best = std::min(best, dp[pl]), pl++;
		dp[i + 1] = std::min(dp[pl] + T + x[pl] * 2, best + x[i] * 2) - x[i + 1] * 2;
	}
	printf("%lld\n", dp[N] + E - x[0] * 2);
	return 0;
}