#include <bits/stdc++.h>
using namespace std;

int a[100010];
long long dp[100010];

int main () {
	int n, E, T; scanf("%d%d%d", &n, &E, &T);
	for (int i = 1; i <= n; i++) {
		scanf("%d", &a[i]);
	}
	memset(dp, 0x3f, sizeof(dp));
	dp[0] = 0;
	int pos = 0;
	long long minj = 0x3f3f3f3f3f3f3f3f;
	for (int i = 1; i <= n; i++) {
		while (2 * (a[i] - a[pos + 1]) >= T) minj = min(minj, dp[pos] - 2 * a[pos + 1]), pos++;
		dp[i] = minj + 2 * a[i];
		if (pos != i) dp[i] = min(dp[i], dp[pos] + T);
	}
	printf("%lld\n", dp[n] + E);
	return 0;
}
