#include<bits/stdc++.h>
#define LL long long
using namespace std;
const int N = 2e5 + 10;
const LL inf = 1e18;

int n;
LL E, t, a[N], dp[N], pre[N];

int main() {
	cin >> n >> E >> t;
	for (int i = 1; i <= n; ++i)
		scanf("%lld", &a[i]);
	dp[0] = 0;
	pre[0] = inf;
	for (int i = 1, j = 1; i <= n; ++i) {
		dp[i] = inf;
		while (2 * (a[i] - a[j]) > t) ++j;
		dp[i] = min(dp[i], dp[j - 1] + t);
		dp[i] = min(dp[i], 2 * a[i] + pre[j - 1]);
		pre[i] = min(pre[i - 1], dp[i - 1] - 2 * a[i]);
	}
	printf("%lld\n", dp[n] + E);
	return 0;
}
