#include<bits/stdc++.h>
 
using namespace std;
 
typedef long long LL;
 
constexpr LL INF = 1e18;
LL dp[100001], dp2[100001];
LL N, T, E;
LL x[100001];
 
int main() {
    scanf("%lld %lld %lld", &N, &E, &T);
    for(int i = 1; i<=N; ++i) scanf("%lld", x+i);
    int now = 1;
    LL mn = -2*x[1];
    for(int i = 1; i<=N; ++i) {
        if( 2*(x[i] - x[1]) <= T ) {
            dp[i] = T;
            continue;
        }
        while( 2*(x[i]-x[now+1]) > T ) {
            mn = min(mn, dp[now]-2*x[now+1]);
            ++now;
        }
        dp[i] = min(dp[now]+T, mn+2*x[i]);
    }
    printf("%lld\n", dp[N]+E);
}