#include <assert.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <algorithm>

unsigned readUnsigned() {
    int c;
    do { c = ::getchar_unlocked(); } while (c < '0');
    unsigned result = c - '0';
    while ((c = ::getchar_unlocked()) >= '0') {
        result *= 10;
        result += c - '0';
    }
    return result;
}


const unsigned MAX_N = 100 * 1000;
uint64_t N, E, T;
uint64_t xs[MAX_N];

long long unsigned reallySimpleDP() {
    /*
     * dp[i]: After just giving candy to bear xs[i] and given that all coins
     *        from bears xs[0]...xs[i-1] have been collected, how long does it
     *        take to end the game?
     *
     */
    uint64_t dp[MAX_N];
    dp[N - 1] = T + E - xs[N - 1];
    for (unsigned i = N - 1; i--;) {
        dp[i] = T + xs[i+1] - xs[i] + dp[i+1];

        /*
         * Try all routes xs[i] -> xs[i+k] -> xs[i] -> xs[i+k].
         *
         * 1) Instead of waiting at xs[i], we go walk xs[i+k].
         * 2) We walk back to xs[i].
         * 3) If the coin hasn't appeared yet, we wait for it.
         * 4) We go to xs[i+k+1], if it exists.  The coin xs[i+k] is ready.
         * 5) To finish the game, the cost is dp[i+k+1].
         */
        for (unsigned j = i + 1; j < N; ++j) {
            uint64_t cost = 2 * (xs[j] - xs[i]);
            if (cost < T) cost = T;
            if (j + 1 < N) {
                cost += xs[j+1] - xs[i] + dp[j+1];
            }
            else {
                cost += E - xs[i];
            }
            dp[i] = std::min(dp[i], cost);
        }
    }
    return xs[0] + dp[0];
}

long long unsigned fastDP() {
    uint64_t dp[MAX_N];
    dp[N - 1] = T + E - xs[N - 1];
    uint64_t mintail = ~0u;
    uint64_t J = N - 2;
    for (unsigned i = N - 1; i--;) {
        dp[i] = T + xs[i+1] - xs[i] + dp[i+1];

        /*
         * Find the largest j for which distance < T.
         */
        unsigned j = i + 1;
        for (unsigned step = 1 + (N - j) / 2; step; step /= 2) {
            for (; j + step < N; j += step) {
                uint64_t distance = 2 * (xs[j + step] - xs[i]);
                if (distance >= T) {
                    break;
                }
            }
        }

        /* Special case: distance < T */
        if (j + 1 < N) {
            uint64_t cost = 2 * (xs[j] - xs[i]);
            if (cost < T) cost = T;
            cost += xs[j+1] - xs[i] + dp[j+1];
            dp[i] = std::min(dp[i], cost);
        }

        for (; J > 0 && 2 * (xs[J] - xs[i]) >= T; --J) {
            mintail = std::min(mintail, dp[J+1] + xs[J+1] + 2*xs[J]);
        }
        dp[i] = std::min(dp[i], mintail - 3*xs[i]);

#if 0
        /* It turns out that this loop does not depend on i.  Coolio. */
        for (; j + 1 < N; ++j) {
            uint64_t cost = (2*xs[j] + xs[j+1] + dp[j+1]) - 3*xs[i];
            dp[i] = std::min(dp[i], cost);
        }
#endif

        /* Special case: j+1==N and dp[j+1] is out of bounds. */
        if (i + 1 < N) {
            j = N - 1;
            uint64_t cost = 2 * (xs[j] - xs[i]);
            if (cost < T) cost = T;
            cost += E - xs[i];
            dp[i] = std::min(dp[i], cost);
        }
    }
    return xs[0] + dp[0];
}

int main() {
#if 0
    ::srand(42);
    for (;;) {
        N = 1000;
        T = 1 + ::rand();
        xs[0] = 1 + ::rand() % 5;
        for (unsigned i = 1; i < N; ++i) {
            xs[i] = xs[i-1] + 1 + ::rand() % 100000;
        }
        E = xs[N-1] + 1 + ::rand() % 100000;
        /*
        printf("N=%u, E=%u, T=%u\n", (unsigned)N, (unsigned)E, (unsigned)T);
        printf("xs =");
        for (unsigned i = 0; i < N; ++i) {
            printf(" %u", (unsigned)xs[i]);
        }
        putchar('\n');
        */
        if (fastDP() != reallySimpleDP()) {
            printf("%llu != %llu\n", fastDP(), reallySimpleDP());
            assert(0);
        }
    }
    return 0;
#endif

    N = readUnsigned();
    E = readUnsigned();
    T = readUnsigned();
    for (unsigned i = 0; i < N; ++i) {
        xs[i] = readUnsigned();
    }

    printf("%llu\n", fastDP());
}


Measured memory_bytes: 1664