#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int n, e, t;
int x[100005];
ll f[100005];
int main()
{
	scanf("%d%d%d", &n, &e, &t);
	for(int i = 1; i <= n; i++)
	{
		scanf("%d", &x[i]);
	}
	ll tmp = 0x3f3f3f3f3f3f3f3f;
	for(int i = 1, j = 1; i <= n; i++)
	{
		while(j <= n && (x[i] - x[j]) * 2 > t)
		{
			tmp = min(tmp, f[j - 1] - x[j] * 2);
			j++;
		}
		f[i] = min(f[j - 1] + t, tmp + x[i] * 2);
	}
	printf("%lld\n", f[n] + e);
	
	
	
	
	return 0;
}