#include <bits/stdc++.h>

typedef long long LL;
const int MAXN = 100010;
const LL INF = 0x3f3f3f3f3f3f3f3fLL;
int at[MAXN], T, n, E;
LL f[MAXN];
int main() {
	std::ios_base::sync_with_stdio(false), std::cin.tie(0);
	std::cin >> n >> E >> T;
	int cur = 0; LL pre = INF;
	for (int i = 1; i <= n; ++i) {
		std::cin >> at[i];
		while (2 * (at[i] - at[cur + 1]) >= T)
			pre = std::min(pre, f[cur] - 2 * at[cur + 1]), ++cur;
		f[i] = std::min(pre + 2 * at[i], f[cur] + T);
	}
	std::cout << f[n] + E << std::endl;
	return 0;
}
