#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

const ll INF = 10000000000000000;

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll n, e, t;
    cin >> n >> e >> t;
    vector<ll> x(n);
    for (int i = 0; i < n; i++) cin >> x[i];
    ll ans = e;
    vector<ll> dp(n + 1, INF);
    dp[0] = 0;
    vector<ll> dp2(n + 1, INF);
    for (int i = 1; i <= n; i++) {
        dp2[i] = min(dp2[i - 1], dp[i - 1] - x[i - 1] * 2);
        int j = upper_bound(x.begin(), x.begin() + i, (2 * x[i - 1] - t) / 2) - x.begin();
        dp[i] = min(dp[j] + t, 2 * x[i - 1] + dp2[j]);
    }
    ans += dp[n];                    
    cout << ans << endl;
    return 0;
}