#include <bits/stdc++.h>

#define FO(i,a,b) for (int i = (a); i < (b); i++)
#define sz(v) int(v.size())

using namespace std;

typedef long long ll;
int n, e, t;
ll x[100005];
ll f[100005];
ll mf[100005];

int main() {
    scanf("%d %d %d", &n, &e, &t);
    FO(i,0,n) scanf("%lld", x+i);
    x[n] = e;

    f[n] = 0;
    mf[n] = 1ll<<60;
    for (int i = n-1; i >= 0; i--) {
        f[i] = 1ll<<60;
        int s = i, _e = n-1, b = i;
        while (s <= _e) {
            int m = (s+_e)/2;
            if (2*(x[m]-x[i]) <= t) {
                b = m;
                s = m+1;
            } else {
                _e = m-1;
            }
        }
        f[i] = min(f[i], f[b+1] + t+x[b+1]-x[i]);
        f[i] = min(f[i], mf[b+1] - 3*x[i]);
        mf[i] = min(mf[i+1], f[i+1] + 2*x[i]+x[i+1]);
    }
    printf("%lld\n", x[0]+f[0]);
}
