#include<bits/stdc++.h>

using namespace std;

#define FOR(i, x, y) for(int i = (x); i < (y); ++i)
#define REP(i, x, y) for(int i = (x); i <= (y); ++i)
#define MP make_pair
#define PB push_back
#define PH push
#define fst first
#define snd second
typedef double db;
typedef long double ldb;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;

const int maxn = 1e5 + 5;
const ll INF = 1e18;

int n, e, t;
int x[maxn];
ll dp[maxn];

int main(){
	scanf("%d%d%d", &n, &e, &t);
	dp[0] = 0;
	REP(i, 1, n)
		scanf("%d", x + i);
	ll mn = INF;
	for(int i = 1, j = 1; i <= n; ++i){
		if(2 * (x[i] - x[1]) <= t)
			dp[i] = t;
		else{
			mn = min(mn, -2ll * x[1]);
			for(; 2 * (x[i] - x[j + 1]) > t; ++j){
				mn = min(mn, dp[j] - 2 * x[j + 1]);
			}
			dp[i] = mn + 2 * x[i];
			dp[i] = min(dp[i], dp[j] + t);
		}
	}
	printf("%lld\n", dp[n] + e);
	return 0;
}