
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace __gnu_pbds;
using namespace std;

#define ff first
#define ss second
#define pb push_back
#define pf push_front
#define mp make_pair
#define popb pop_back
#define popf pop_front
#define all(v) v.begin(), v.end()
#define fori(i, j, k) for (int i = (j); i < (int)(k); i++)
#define forb(i, j, k) for (int i = (j); i >= (int)k; i--)
#define lchild(ind) 2 * ind + 1
#define rchild(ind) 2 * ind + 2
#define bug(val) cout << "# " << val << endl;
#define bugs(val) cout << '_' << val;
#define bugl(val) cout << "## " << val << endl;

template<typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<int, ll> pil;
typedef pair<ll, int> pli;
typedef pair<ll, ll> pll;
typedef pair<int, pll> pip;
typedef pair<ll, pll> plp;
typedef pair<pll, int> ppi;
typedef pair<pll, ll> ppl;
typedef pair<pll, pll> ppp;
typedef vector<int> vi;
typedef vector<ll> vll;

const int maxn = 1e5 + 1;
const ll inf = 2e18, mod = 1e9 + 7;

int n, x[maxn], dp[maxn], seg[4 * maxn], E, T, ind;

void build(int u, int l, int r)
{
	if (r - l == 1)
	{
		seg[u] = -x[l] * 2;
		return;
	}
	int mid = (l + r) / 2;
	build(lchild(u), l, mid);
	build(rchild(u), mid, r);
	seg[u] = min(seg[lchild(u)], seg[rchild(u)]);
}

void update(int u, int l, int r, int x, int val)
{
	if (r - l == 1)
	{
		seg[u] += val;
		return;
	}
	int mid = (l + r) / 2;
	if (x < mid)
		update(lchild(u), l, mid, x, val);
	else
		update(rchild(u), mid, r, x, val);
	seg[u] = min(seg[lchild(u)], seg[rchild(u)]);
}

int query(int u, int l, int r, int b, int e)
{
	if (r == l)
		return inf;
	if (b <= l && r <= e)
		return seg[u];
	int mid = (l + r) / 2, tmp = inf;
	if (b < mid)
		tmp = min(tmp, query(lchild(u), l, mid, b, e));
	if (e > mid)
		tmp = min(tmp, query(rchild(u), mid, r, b, e));
	return tmp;
}

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);

	cin >> n >> E >> T;
	fori (i, 0, n)
		cin >> x[i];
	sort(x, x + n);
	build(0, 0, n);
	fori (i, 0, n)
	{
		ind = lower_bound(x, x + n, x[i] - T / 2) - x;
		dp[i] = min(2 * x[i] + query(0, 0, n, 0, ind), T + (ind ? dp[ind - 1] : 0));
		update(0, 0, n, i + 1, dp[i]);
	}
	cout << dp[n - 1] + E << endl;
}
