#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn = 1e5 + 10;
int n, E, T, r;
int a[maxn];
ll Min1, Min2 = 1e18, f[maxn];
int main()
{
	deque<ll> Q; 
	scanf("%d%d%d", &n, &E, &T);
	for(int i = 1; i <= n; ++i) scanf("%d", &a[i]);
	Q.push_back(0);
	for(int i = 1; i <= n; ++i)
	{
		while((a[i] - a[r + 1]) * 2 >= T)
		{
			Min2 = min(Min2, f[r] - 2 * a[r + 1]);
			while(Q.front() <= r) Q.pop_front();
			++r;
		}
		f[i] = min(Min1 + 1ll * i * T, Min2 + 2 * a[i]);
		if(!Q.empty()) f[i] = min(f[i], f[Q.front()] + T);
		Min1 = min(Min1, f[i] - 1ll * i * T);
		while(!Q.empty() && f[i] <= f[Q.back()]) Q.pop_back();
		Q.push_back(i);
	}
	printf("%lld\n", f[n] + E);
	return 0;
}