/+ dub.sdl:
    name "A"
    dependency "dcomp" version=">=0.0.2"
+/

import std.algorithm, std.range, std.stdio, std.math, std.conv, core.bitop;

// import dcomp.scanner;
// import dcomp.algorithm;
// import dcomp.container.simpleSeg;
import std.container.util;

int main() {
    auto sc = new Scanner();
    int n; long e, T;
    long[] x;
    sc.read(n, e, T, x);
    x ~= e;
    long[] next = iota(n).map!(i => x[i+1]-x[i]).array;
    long[] dp = new long[](n+1);
    auto tr1 = SimpleSeg!(long, min, 10L^^12)(n);
    auto tr2 = SimpleSeg!(long, min, 10L^^12)(n);
    dp[n] = 0;
    foreach_reverse (i; 0..n) {
        tr1[i] = dp[i+1] + 3*x[i] + next[i];
        tr2[i] = dp[i+1] + T + x[i] + next[i];
        int div = binSearch!(j => 2*(x[j]-x[i]) >= T)(i, n);
        //[div, n-1) tr1
        //[i, div) tr2
        long ans = 10L^^12;
        ans = min(ans, tr1.sum(div, n) - 3*x[i]);
        ans = min(ans, tr2.sum(i, div) - x[i]);
        dp[i] = ans;
    }
    writeln(dp[0] + x[0]);
	return 0;
}
/* IMPORT /Users/yosupo/Program/dcomp/source/dcomp/scanner.d */
// module dcomp.scanner;

class Scanner {
    import std.stdio : File, readln, stdin;
    import std.conv : to;
    import std.range : front, popFront, array, ElementType;
    import std.array : split;
    import std.traits : isSomeString, isDynamicArray;
    import std.algorithm : map;
    File f;
    this(File f = stdin) {
        this.f = f;
    }
    string[] buf;
    bool succ() {
        while (!buf.length) {
            if (f.eof) return false;
            buf = readln.split;
        }
        return true;
    }
    int read(Args...)(auto ref Args args) {
        foreach (i, ref v; args) {
            if (!succ()) return i;
            alias VT = typeof(v);
            static if (!isSomeString!VT && isDynamicArray!VT) {
                v = buf.map!(to!(ElementType!VT)).array;
                buf.length = 0;
            } else {
                v = buf.front.to!VT;
                buf.popFront();
            }
        }
        return args.length;
    }
}
/* IMPORT /Users/yosupo/Program/dcomp/source/dcomp/container/simpleSeg.d */
// module dcomp.container.simpleSeg;

// simpleなsegtree
// a op b op .. op x が求められる、遅延評価なし
// (T, op)はモノイドの必要がある、eはモノイド
struct SimpleSeg(T, alias op, T e) {
    const size_t n, sz;
    T[] d;
    @disable this();
    this(size_t n) {
        import std.algorithm : fill;
        import core.bitop : bsr;
        int lg = n.bsr;
        if ((2^^lg) < n) lg++;
        this.n = n;
        this.sz = 2^^lg;
        d = new T[](2*this.sz);
        d.fill(e);
    }
    void opIndexAssign(T v, int idx) {
        import std.stdio : writeln;
        idx += sz;
        d[idx] = v;
        while (idx/2 >= 1) {
            idx /= 2;
            d[idx] = op(d[2*idx], d[2*idx+1]);
        }
    }
    //todo more beautiful?
    T sum(size_t a, size_t b, size_t l, size_t r, size_t k) {
        if (b <= l || r <= a) return e;
        if (a <= l && r <= b) return d[k];
        size_t md = (l+r)/2;
        return op(sum(a, b, l, md, 2*k),
            sum(a, b, md, r, 2*k+1));
    }
    //[a, b)
    T sum(size_t a, size_t b) {
        return sum(a, b, 0, sz, 1);
    }
    //todo formatspec?
    string toString() {
        import std.conv : to;
        return d[sz..sz+n].to!string;
    }
}
/* IMPORT /Users/yosupo/Program/dcomp/source/dcomp/algorithm.d */
// module dcomp.algorithm;

//[0,0,0,...,1,1,1]で、初めて1となる場所を探す。pred(l) == 0, pred(r) == 1と仮定
T binSearch(alias pred, T)(T l, T r) {
    while (r-l > 1) {
        int md = (l+r)/2;
        if (!pred(md)) l = md;
        else r = md;
    }
    return r;
}
