#include <bits/stdc++.h>

using namespace std;

typedef long long LL;

const LL INF = 1e18;
const int N = 100010;

LL f[N];

int x[N];
int n, T, E;

int main() {
	scanf("%d %d %d", &n, &E, &T);
	for (int i = 1; i <= n; i++) {
		scanf("%d", &x[i]);
	}
	int p = 0;
	LL mn = INF;
	for (int i = 1; i <= n; i++) {
		f[i] = INF;
		while(2 * (x[i] - x[p + 1]) > T) {
			mn = min(f[p] - 2 * x[p + 1], mn);
			++p;
		}
		f[i] = min(f[i], mn + 2 * x[i]);
		f[i] = min(f[i], f[p] + T);
	}
	cout << f[n] + E << endl;
	return 0;
}