#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()
{
	multiset<ll> S; 
	scanf("%d%d%d", &n, &E, &T);
	for(int i = 1; i <= n; ++i) scanf("%d", &a[i]);
	S.insert(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]);
			S.erase(S.find(f[r]));
			++r;
		}
		f[i] = min(Min1 + 1ll * i * T, Min2 + 2 * a[i]);
		if(!S.empty()) f[i] = min(f[i], *S.begin() + T);
		Min1 = min(Min1, f[i] - 1ll * i * T);
		S.insert(f[i]); 
	}
	printf("%lld\n", f[n] + E);
	return 0;
}