#include <iostream>
#include <cstdio>
#include <vector>
#include <string>
#include <algorithm>

#define rep(i,n) for(int i=0; i<(n); i++)
#define rrep(i,n) for(int i=(n)-1; i>=0; i--)
#define all(X) (X).begin(),(X).end()

using namespace std;
typedef long long int ll;
typedef pair<int,int> pii;

template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; }

template<class A, size_t N, class T> void Fill(A (&a)[N], const T &v){ fill( (T*)a, (T*)(a+N), v ); }

const ll INF = 1e15;


int main(){
	ll N, E, T;
	ll x[100005]={};

	cin >> N >> E >> T;
	rep(i,N) cin >> x[i];
	x[N] = E;

	N = min(N, 2000);

	ll dp[2][100005]={};
	rep(i,N){
		Fill( dp[(i+1)%2], INF );
		ll dist = x[i+1] - x[i];
		rep(j,i+1){
			chmin( dp[(i+1)%2][j], dp[i%2][j] + dist );

			ll back = (x[i] - x[j]) * 2;
			ll t = max( back, T );
			chmin( dp[(i+1)%2][i+1], dp[i%2][j] + t + dist );
		}
		//rep(j,N+1) cout << dp[(i+1)%2][j] << " "; cout << endl;
	}

	ll ans = dp[N%2][N] + x[0];// + E-x[N-1];
	cout << ans << endl;

	return 0;
}
