#include <bits/stdc++.h>
#define f first
#define s second
using namespace std;
using ll = long long;
using ii = pair<int, int>;
constexpr int MN = 1e5+1;

ll N, E, T, A, B = 1e18, x[MN], DP[MN];

int main() {
	if (fopen("in", "r")) freopen("in", "r", stdin), freopen("out", "w", stdout);
	ios_base::sync_with_stdio(0), cin.tie(0);

	cin >> N >> E >> T;
	for (int i = 0; i < N; ++i) cin >> x[i];

	multiset<ll> S;
	S.insert(0);
	for (int i = 0, j = 0; i < N; ++i) {
		while (2*(x[i]-x[j]) >= T) {
			B = min(DP[j]-2*x[j], B);
			S.erase(S.find(DP[j]));
			++j;
		}
		DP[i+1] = min(A+(i+1)*T, B+2*x[i]);
		if (S.size()) DP[i+1] = min(*begin(S)+T, DP[i+1]);
		A = min(DP[i+1]-(i+1)*T, A);
		S.insert(DP[i+1]);
	}
	cout << DP[N]+E;
}
