#include<cstdio>
#include<algorithm>
#include<cstring>
#include<iostream>
#include<cmath>
#include<cctype>
#include<set>
#include<queue>
#include<vector>
#include<map>
using namespace std;
typedef long long LL;

inline int read() {
	int x=0,f=1;char ch=getchar();for(;!isdigit(ch);ch=getchar())if(ch=='-')f=-1;
	for(;isdigit(ch);ch=getchar())x=x*10+ch-'0';return x*f;
}

const int N = 1000005;
LL f[N], p[N];

int main() {
//	freopen("a.in", "r", stdin);
	int n = read(), E = read(), T = read();
	for (int i = 1; i <= n; ++i) p[i] = read();
	LL Mn = 1e18;
	int j = 0;
	for (int i = 1; i <= n; ++i) {
		while (j <= i && 2 * (p[i] - p[j + 1]) > T) {
			Mn = min(Mn, f[j] - 2 * p[j + 1]);
			++ j;
		}
		if (j < i) f[i] = f[j] + T;
		f[i] = min(f[i], Mn + 2 * p[i]);
	}
	cout << f[n] + E;
	return 0;
}