#include <bits/stdc++.h>

typedef long long LL;
const LL inf = 0x3f3f3f3f3f3f3f3f;
const int N = 100005;

int n, e, t, x[N];
LL dp[N];

int main() {
	std::ios::sync_with_stdio(0), std::cin.tie(0);
	std::cin >> n >> e >> t;
	for (int i = 1; i <= n; ++i) std::cin >> x[i];
	int k = 0; LL left_min = inf;
	for (int i = 1; i <= n; ++i) {
		while (2 * (x[i] - x[k + 1]) > t) left_min = std::min(left_min, dp[k] - 2 * x[k + 1]), ++k;
		dp[i] = std::min(left_min + 2 * x[i], dp[k] + t);
	}
	std::cout << dp[n] + e << '\n';
	return 0;
}