#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef pair<int, int> P;
template<typename T> inline void chkmin(T &a, const T &b) { a = a < b ? a : b; }
template<typename T> inline void chkmax(T &a, const T &b) { a = a > b ? a : b; }

const int MAXN = 100005;
int que[MAXN], x[MAXN], n, T, E;
LL f[MAXN];

int main() {
	scanf("%d%d%d", &n, &E, &T);
	int he = 1, ta = 0;
	LL mn = 1e18;
	que[++ta] = 0;
	for (int i = 1, pos = 0; i <= n; i++) {
		scanf("%d", x + i);
		for (; 2 * (x[i] - x[pos + 1]) >= T; ++pos)
			chkmin(mn, f[pos] - x[pos] - 2 * x[pos + 1]);
		f[i] = mn + 3ll * x[i];
		while (he <= ta && que[he] < pos) ++he;
		chkmin(f[i], f[que[he]] - x[que[he]] + x[i] + T);
		while (he <= ta && f[i] - x[i] <= que[ta]) --ta;
		que[++ta] = i;
	}
	printf("%lld\n", f[n] + E - x[n]);
	return 0;
}