#include <bits/stdc++.h>

using namespace std;

constexpr int N = 1e5 + 10;
constexpr int MOD = 1e9 + 7;

long long t, n, a[N], mn, dp[N], e, en, ps[N];

void upd (int x) {
    if (!mn)
        mn = x;
    long long ghabli = 2 * a[mn] + a[mn + 1] + dp[mn + 1];
    long long jadid = 2 * a[x] + a[x + 1] + dp[x + 1];
    if (jadid < ghabli)
        mn = x;
}

int main() {
    ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
    cin >> n >> e >> t;
    for (int i = 1; i <= n; i++)
        cin >> a[i];
    en = n;
    a[n + 1] = e;
    for (int i = n; i; i--) {
        while (2 * (a[en] - a[i]) > t) {
            upd (en);
            en--;
        }
        // ta en berim va bargardim
        dp[i] = t + a[en + 1] - a[i] + dp[en + 1];
        // ta min berim va bargardim
        if (mn)
            dp[i] = min (dp[i], 2 * a[mn] + a[mn + 1] + dp[mn + 1] - 3 * a[i]);
    }
    cout << dp[1] + a[1] << '\n';
    return 0;
}
