#include <bits/stdc++.h>

using namespace std;
typedef long long ll;

const int MAXN = 100005;

int n, e, T;
int x[MAXN];

void input()
{
	scanf("%d%d%d", &n, &e, &T);
	for(int i = 1; i <= n; i++)
		scanf("%d", &x[i]);
}

ll f[MAXN];

void solve()
{
	f[0] = 0;
	ll minv = 1e18;
	int j = 0;
	for(int i = 1; i <= n; i++)
	{
		f[i] = f[i - 1] + T;
		while(2 * (x[i] - x[j + 1]) > T)
		{
			minv = min(minv, f[j] - 2 * x[j + 1]);
			j++;
		}
		f[i] = min(f[i], f[j] + T);
		f[i] = min(f[i], minv + 2 * x[i]);
	}
}

void output()
{
	printf("%lld\n", f[n] + e);
}

int main()
{
	input();
	solve();
	output();

	return 0;
}
