#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
class MQ {
	private:
	deque<ll> q;
	public:
	void push(ll val) {
		while(!(q.empty()) && q.back() > val) {
			q.pop_back();
		}
		q.push_back(val);
	}
	void pop(ll val) {
		if(!q.empty() && q.front() == val) {
			q.pop_front();
		}
	}
	ll front() {
		return q.front();
	}
};
vl w,dp;
int main() {
	ll n,ti,ed;
	cin >> n >> ed >> ti;
	for(int i=0;i<n;i++) {
		ll t;
		cin >> t;
		w.push_back(t);
	}
	w.push_back(ed);
	dp.assign(w.size(),1e18);

	dp.back() = 0;
	ll rv = 1e18;
	MQ q;
	ll pt = dp.size()-1;
	q.push(0);
	for(int i=n-1;i>=0;i--) {
		while(pt > i && (w[pt-1]-w[i])*2 > ti) {
			q.pop(dp[pt]);
			rv = min(rv,dp[pt]+(w[pt-1]-w[i])*2);
			pt--;
		}
		dp[i] = min(q.front()+ti,rv);
		q.push(dp[i]);
		if(i > 0) {
			rv += 2*(w[i]-w[i-1]);
		}
	}
	//what
	cout << dp[0]+ed << '\n';
}
