#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> pii;

const int MAXN = 1e5+5;

ll n, dp[MAXN], x[MAXN], e, t, ct;
set<pii> dp1, dp2;

int main() {
	cin >> n >> e >> t;
	for (int i = 0; i < n; ++i)
		cin >> x[i];
	x[n] = e;

	dp[0] = x[0];
	dp1.insert(pii(dp[0]-x[0], 0));
	for (int j = 1; j <= n; ++j) {
		dp[j] = 1e18;
		while (2*(x[j-1]-x[ct]) > t) {
			dp1.erase(pii(dp[ct]-x[ct], ct));
			dp2.insert(pii(dp[ct]-3*x[ct], ct));
			++ct;
		}

		if (!dp1.empty())
			dp[j] = min(dp[j], (*dp1.begin()).first+t+x[j]);
		if (!dp2.empty())
			dp[j] = min(dp[j], (*dp2.begin()).first+x[j]+2*x[j-1]);
		dp1.insert(pii(dp[j]-x[j], j));
	}

	cout << dp[n] << endl;
}
