# include <cstdio>
# include <algorithm>
using namespace std;

# define REP(i, n) for (int i = 1; i <= n; ++ i)
# define NR 101000

typedef long long ll;

int n, E, T;
ll f[NR], x[NR];

int main() {
	scanf ("%d%d%d", &n, &E, &T);
	int p = 0;
	ll s = 1e12;
	REP (i, n) {
		scanf ("%lld", &x[i]);
		
		while (p < i && 2 * (x[i] - x[p + 1]) >= T) {
			s = min (s, f[p] - x[p] - 2 * x[p + 1]);
			++ p;
			
		}
		f[i] = s + 3 * x[i];
		//printf ("(p:%d) ", p);
		if (p != i) f[i] = min (f[i], f[p] - x[p] + x[i] + T);
		//printf ("%I64d ", f[i]);
	}
	
	printf ("%lld\n", f[n] + E - x[n]);
	
	return 0;
}

//j -> i -> j+1 -> i

//f[i] = f[j] + x[i] - x[j] + max(2 * (x[i] - x[j + 1]), T)
//f[i] = f[j] - x[j] + x[i] + T
//f[i] = f[j] - x[j] - 2 * x[j + 1] + 3 * x[i]
