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

#include <cmath>

#include <set>



#define incID(i, l, r) for(int i = (l)    ; i <  (r); i++)

#define incII(i, l, r) for(int i = (l)    ; i <= (r); i++)

#define decID(i, l, r) for(int i = (r) - 1; i >= (l); i--)

#define decII(i, l, r) for(int i = (r)    ; i >= (l); i--)

#define inc( i, n) incID(i, 0, n)

#define inc1(i, n) incII(i, 1, n)

#define dec( i, n) decID(i, 0, n)

#define dec1(i, n) decII(i, 1, n)



typedef long long   signed int LL;

typedef long long unsigned int LU;



template<typename T> void swap(T &x, T &y) { T t = x; x = y; y = t; return; }

template<typename T> T abs(T x) { return (0 <= x ? x : -x); }

template<typename T> T max(T a, T b) { return (b <= a ? a : b); }

template<typename T> T min(T a, T b) { return (a <= b ? a : b); }

template<typename T> bool setmin(T &a, T b) { if(a <= b) { return false; } else { a = b; return true; } }

template<typename T> bool setmax(T &a, T b) { if(b <= a) { return false; } else { a = b; return true; } }

template<typename T> T gcd(T a, T b) { return (b == 0 ? a : gcd(b, a % b)); }

template<typename T> T lcm(T a, T b) { return a / gcd(a, b) * b; }



// ---- ----



LL n, e, t, x[100002];

LL dp[100001];

int m[100001];

const LL MAX = 1000000000000000LL;



std::multiset<LL> ms;



LL mi1_v = MAX;

LL mi1(int i) {

	incID(j, m[i - 1], m[i]) { setmin(mi1_v, dp[j] - 2 * x[j + 1]); }

	return mi1_v;

}



LL mi2(int i) {

	incID(j, m[i - 1], m[i]) {

		auto it1 = ms.find(dp[j]);

		auto it2 = it1;

		it2++;

		ms.erase(it1, it2);

	}

	ms.insert(dp[i - 1]);

	return *ms.begin();

	

	/*

	ms.clear();

	incID(j, m[i], i) { ms.insert(dp[j]); }

	return *(ms.begin());

	*/

}



int main() {

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

	inc1(i, n) { scanf("%lld", &x[i]); }

	

	int mm = 0;

	inc1(i, n) {

		while( (x[i] - x[mm + 1]) * 2 > t) { mm++; }

		m[i] = mm;

	}

	

	inc1(i, n) {

		dp[i] = min(mi1(i) + 2 * x[i], mi2(i) + t);

	}

	

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

	

	return 0;

}


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

#include <cmath>

#include <set>



#define incID(i, l, r) for(int i = (l)    ; i <  (r); i++)

#define incII(i, l, r) for(int i = (l)    ; i <= (r); i++)

#define decID(i, l, r) for(int i = (r) - 1; i >= (l); i--)

#define decII(i, l, r) for(int i = (r)    ; i >= (l); i--)

#define inc( i, n) incID(i, 0, n)

#define inc1(i, n) incII(i, 1, n)

#define dec( i, n) decID(i, 0, n)

#define dec1(i, n) decII(i, 1, n)



typedef long long   signed int LL;

typedef long long unsigned int LU;



template<typename T> void swap(T &x, T &y) { T t = x; x = y; y = t; return; }

template<typename T> T abs(T x) { return (0 <= x ? x : -x); }

template<typename T> T max(T a, T b) { return (b <= a ? a : b); }

template<typename T> T min(T a, T b) { return (a <= b ? a : b); }

template<typename T> bool setmin(T &a, T b) { if(a <= b) { return false; } else { a = b; return true; } }

template<typename T> bool setmax(T &a, T b) { if(b <= a) { return false; } else { a = b; return true; } }

template<typename T> T gcd(T a, T b) { return (b == 0 ? a : gcd(b, a % b)); }

template<typename T> T lcm(T a, T b) { return a / gcd(a, b) * b; }



// ---- ----



LL n, e, t, x[100002];

LL dp[100001];

int m[100001];



int main() {

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

	inc1(i, n) { scanf("%lld", &x[i]); }

	

	int mm = 0;

	inc1(i, n) {

		while( (x[i] - x[mm + 1]) * 2 > t) { mm++; }

		m[i] = mm;

	}

	

	LL mi = 1000000000000000LL;

	inc1(i, n) {

		incID(j, m[i - 1], m[i]) { setmin(mi, dp[j] - 2 * x[j + 1]); }

		dp[i] = min(mi + 2 * x[i], dp[ m[i] ] + t);

	}

	

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

	

	return 0;

}