#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#pragma GCC target ("avx")
#pragma GCC target ("avx2")
#pragma GCC target ("fma")
#pragma GCC optimize ("Ofast")
#pragma GCC optimization ("unroll-loops, no-stack-protector")
#define fastio ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define ll long long
#define ull unsigned long long
#define ld long double
#define pii pair <int, int>
#define pll pair <ll, ll>
#define pci pair <char, int>
#define pld pair <ld, ld>
#define ppld pair <pld, pld>
#define ppll pair <pll, pll>
#define pldl pair <ld, ll>
#define vll vector <ll>
#define vvll vector <vll>
#define vpll vector <pll>
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define fi first
#define se second
#define mll map <ll, ll>
#define fastmap gp_hash_table
#define cd complex <double>
#define vcd vector <cd>
#define PI 3.14159265358979
#define ordered_set tree <ll, null_type, less <ll>, rb_tree_tag, tree_order_statistics_node_update>
#pragma 03
using namespace std;
using namespace __gnu_pbds;
// hj cho minh bulli bai nay
ll dp[200005], a[200005];
int st[800005][2]; 
void update(ll root, ll l, ll r, ll i, ll val, ll id){
	if (i < l || r < i) return;
	if (l == r){
		st[root][id] = val; return;
	}
	int mid = (l + r) / 2;
	update(root * 2 + 1, l, mid, i, val, id);
	update(root * 2 + 2, mid + 1, r, i, val, id);
	st[root][id] = min(st[root * 2 + 1][id], st[root * 2 + 2][id]);
}
ll query(ll root, ll l, ll r, ll u, ll v, ll id){
	if (v < l || r < u) return 1e18;
	if (u <= l && r <= v) return st[root][id];
	ll mid = (l + r) / 2;
	return min(query(root * 2 + 1, l, mid, u, v, id), query(root * 2 + 2, mid + 1, r, u, v, id));
}
int main(){
	fastio;
	ll n, e, t; cin >> n >> e >> t;
	for (ll i = 1; i <= n; i++) cin >> a[i];
	dp[0] = 0;
	update(0, 0, n - 1, 0, dp[0] - 2 * a[1], 0);
	for (ll i = 1; i <= n; i++){
		dp[i] = 1e18;
		ll lw; 
		ll l = 0, r = i - 1;
		while (l < r){
			ll mid = (l + r) / 2;
			if ((a[i] - a[mid]) * 2 <= t) r = mid;
			else l = mid + 1;
		}
		lw = l;
		dp[i] = min(query(0, 0, n - 1, 0, lw - 1, 0) + 3 * a[i], query(0, 0, n - 1, lw, i - 1, 1) + a[i] + t);
		update(0, 0, n - 1, i, dp[i] - 2 * a[i + 1] - a[i], 0); update(0, 0, n - 1, i, dp[i] - a[i], 1);
	}
	cout << dp[n] + (e - a[n]) << endl;
}