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

void chmin(int64_t &x, int64_t y) {
    if (x > y) x = y;
}

int64_t dp[2020][2020];

int main() {
    int n;
    int64_t T, E;
    cin >> n >> E >> T;
    vector<long long> x(n);
    for (int i = 0; i < n; i++) scanf("%lld", &x[i]);
    vector<int64_t> d(n), ds(n + 1);
    for (int i = 0; i < n - 1; i++) d[i] = x[i + 1] - x[i];
    for (int i = 0; i < n; i++) ds[i + 1] = ds[i] + d[i];

    if (n > 2000) return 0;

    fill_n(*dp, 2020 * 2020, 1e17);
    dp[0][0] = 0;

    for (int i = 0; i < n; i++) {
        for (int j = 0; j <= i; j++) {
            // wait
            if (j == 0) {
                chmin(dp[i + 1][0], dp[i][j] + T + d[i]);
            }

            // return
            if (j > 0) {
                int64_t dist = ds[i] - ds[i - j];
                chmin(dp[i + 1][0], dp[i][j] + d[i] + max(0LL, T - 2 * dist) + dist * 2);
            }

            // ignore
            if (i < n - 1) {
                chmin(dp[i + 1][j + 1], dp[i][j] + d[i]);
            }
        }
    }

    int64_t ans = dp[n][0] + x[0] + (E - x[n - 1]);
    cout << ans << endl;
}
