/+ 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;

struct Node {
    alias NP = Node*;
    long mi;
    NP l, r;
    int sz;
    this(int sz) {
        this.sz = sz;
        if (sz == 1) return;
        l = new Node(sz/2);
        r = new Node(sz-sz/2);
    }
    void set(int k, long x) {
        if (sz == 1) {
            mi = x;
            return;
        }
        if (k < sz/2) {
            l.set(k, x);
        } else {
            r.set(k-sz/2, x);
        }
        mi = min(l.mi, r.mi);
    }
    long get(int a, int b) {
        if (b <= 0 || sz <= a) return 10L^^12;
        if (a <= 0 && sz <= b) return mi;
        return min(l.get(a, b), r.get(a-sz/2, b-sz/2));
    }
    string toString() {
        if (sz == 1) {
            return mi.to!string ~ ", ";
        }
        return l.toString ~ r.toString;
    }
}

int main() {
    import std.conv;
    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;
//    writeln(next);
    long[] dp = new long[](n+1);
    Node* tr1 = new Node(n); //dp[i+1] + 3*dist[j] + next[j]
    Node* tr2 = new Node(n); //dp[i+1] + T + dist[j] + next[j]
    dp[n] = 0;
    foreach_reverse (i; 0..n) {
        tr1.set(i, dp[i+1] + 3*x[i] + next[i]);
        tr2.set(i, dp[i+1] + T + x[i] + next[i]);
//        writeln(tr1.toString);
//        writeln(tr2.toString);
        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.get(div, n) - 3*x[i]);
//        writeln(i, " a ", div, " ", tr1.get(div, n));
        ans = min(ans, tr2.get(i, div) - x[i]);
        dp[i] = ans;
    }
//    writeln(dp);
    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/algorithm.d */
// module dcomp.algorithm;

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


Measured memory_bytes: 19124