#include <bits/stdc++.h>
using namespace std;

#define LL long long

const int maxN = 1e5 + 100;

int n;
int q[maxN + 1];
LL x[maxN + 1], T, E, f[maxN + 1], ans;

int main()
{
	scanf("%d %lld %lld", &n, &E, &T);
	for(int i = 1; i <= n; i++) scanf("%lld", &x[i]), ans += x[i] - x[i - 1];
	ans += E - x[n];

	int now = 0, head = 1, tail = 0;
	LL minT = 1e18; q[++ tail] = 0;
	for(int i = 1; i <= n; i++)
	{
		while(head <= tail && 2 * (x[i] - x[ q[head] + 1 ]) >= T) head ++;
		while(now < i && 2 * (x[i] - x[now + 1]) >= T) 
			minT = min(minT, f[now] - 2 * x[now + 1]), now ++;
		f[i] = minT + 2 * x[i];
		if(head <= tail) f[i] = min(f[i], f[ q[head] ] + T);
		while(head <= tail && f[i] <= f[ q[tail] ]) tail --;
		q[++ tail] = i;
	}

	printf("%lld", ans + f[n]);
	return 0;
}