// Slower C++ solution:
#include <cstdio>

#include <algorithm>

#include <cstring>



typedef long long ll;



int n, e, t, x[100005];

ll dp[100005];



namespace SegTree {

	ll mn[100005 << 2];

	

	void init() { memset(mn, 0x3f, sizeof mn); }

	

	void modify(int k, int l, int r, int pos, ll val) {

		if (l == r) {

			mn[k] = val; return;

		}

		int mid = (l + r) >> 1;

		if (pos <= mid) modify(k << 1, l, mid, pos, val);

		else modify(k << 1 | 1, mid + 1, r, pos, val);

		mn[k] = std::min(mn[k << 1], mn[k << 1 | 1]);

	}

	

	ll query(int k, int l, int r, int L, int R) {

		if (L > R) return 0x3f3f3f3f3f3f3f3fll;

		if (L <= l && r <= R) return mn[k];

		int mid = (l + r) >> 1;

		ll res = 0x3f3f3f3f3f3f3f3fll;

		if (L <= mid) res = std::min(res, query(k << 1, l, mid, L, R));

		if (mid < R) res = std::min(res, query(k << 1 | 1, mid + 1, r, L, R));

		return res;

	}

}



int main() {

	scanf("%d%d%d", &n, &e, &t);

	for (int i = 1; i <= n; ++i) scanf("%d", x + i);

	

	SegTree::init();

	

	int l = 0;

	SegTree::modify(1, 0, n, 0, 0);

	for (int i = 1; i <= n; ++i) {

		while ((x[i] - x[l + 1]) * 2 >= t) {

			SegTree::modify(1, 0, n, l, dp[l] - x[l + 1] * 2);

			++l;

		}

		dp[i] = std::min(t + SegTree::query(1, 0, n, l, i - 1), 

						 x[i] * 2 + SegTree::query(1, 0, n, 0, l - 1));

		SegTree::modify(1, 0, n, i, dp[i]);

	}

	

	printf("%lld\n", dp[n] + e);

	

	return 0;

}


// Faster C++ solution for the same problem (measured speedup: 1.8971513163190679x):
#include <cstdio>

#include <cstring>

#include <algorithm>

#include <cmath>

#include <cstdlib>



#define cmax(_a, _b) (_a < (_b) ? _a = (_b), 1 : 0)

#define cmin(_a, _b) (_a > (_b) ? _a = (_b), 1 : 0)

#define dmax(_a, _b) ((_a) > (_b) ? (_a) : (_b))

#define dmin(_a, _b) ((_a) < (_b) ? (_a) : (_b))



#define maxn 100010

#define lowbit(_x) ((_x) & (-(_x)))

typedef long long ll;

typedef double db;



const ll inf = 0x7ffffffffff;

ll f[maxn];

int x[maxn], hash[maxn], hcnt;

ll tr1[maxn], tr2[maxn];

void modify1(int pos, ll val)

{

	for (; pos <= hcnt; pos += lowbit(pos)) cmin(tr1[pos], val);

}

void modify2(int pos, ll val)

{

	for (; pos; pos -= lowbit(pos)) cmin(tr2[pos], val);

}

ll query1(int pos)

{

	ll ret = inf;

	for (; pos; pos -= lowbit(pos)) cmin(ret, tr1[pos]);

	return ret;

}

ll query2(int pos)

{

	ll ret = inf;

	for (; pos <= hcnt; pos += lowbit(pos)) cmin(ret, tr2[pos]);

	return ret;

}

int main()

{

	int n, E, T; scanf("%d%d%d", &n, &E, &T);

	for (int i = 1; i <= n; ++i) scanf("%d", x + i);

	for (int i = 0; i <= n; ++i) hash[++hcnt] = 2 * x[i];



	memset(tr1, 63, sizeof (tr1));

	memset(tr2, 63, sizeof (tr2));

	f[0] = 0;

	modify1(2, -2 * x[1]);

	modify2(2, 0);

	for (int i = 1; i <= n; ++i)

	{

		f[i] = inf;



		int pos = std::upper_bound(hash + 1, hash + hcnt + 1, 2 * x[i] - T) - hash - 1;

//		printf("pos %d\n", pos);

		ll tmp = query1(pos) + 3ll * x[i];

		cmin(f[i], tmp);

//		printf("tmp %lld\n", tmp);



		pos = std::lower_bound(hash + 1, hash + hcnt + 1, 2 * x[i] - T) - hash;

//		printf("pos %d\n", pos);

		tmp = query2(pos) + T + x[i];

		cmin(f[i], tmp);

//		printf("tmp %lld\n", tmp);

		

		modify1(i + 2, f[i] - 2ll * x[i + 1] - x[i]);

		modify2(i + 2, f[i] - x[i]);

		

//		printf("f[%d] = %lld\n", i, f[i]);

	}

	printf("%lld\n", f[n] + E - x[n]);

	return 0;

}