#include <bits/stdc++.h>
using namespace std;

using ll = long long;

int main(){
	ll n, e, t;
	cin >> n >> e >> t;
	vector<ll> ps(n);
	for(auto& x : ps) cin >> x;

	vector<ll> d(n, 0);

	ll best_left = 1000000001;
	multiset<ll> inner_best;

	auto get_dyn_minus_unu = [&](const ll x){
		return x == 0 ? 0 : d[x-1]; };

	for(ll i = 0, st = 0; i < n; ++i){
		if(i != 0) best_left += 2 * (ps[i] - ps[i-1]);
		inner_best.insert(get_dyn_minus_unu(i));
		while(2 * (ps[i] - ps[st]) >= t){
			inner_best.erase(inner_best.find(get_dyn_minus_unu(st)));
			best_left = min(best_left, 2 * (ps[i] - ps[st]) + get_dyn_minus_unu(st));
			++st; }
		ll rez = best_left;
		if(!inner_best.empty()){
			rez = min(rez, *begin(inner_best) + t); }
		d[i] = rez; }

	cout << d.back() + e << endl;
	return 0; }
