#include <bits/stdc++.h>
using namespace std;

#define fi first
#define se second
typedef pair<int,int> PII;

int n, E, T, a[1<<17];
long long dp[1<<17], dp2[1<<17], mdp2 = (1<<30);

int main() {
    cin >> n >> E >> T;
    for (int i = 1; i <= n; i++) cin >> a[i];
    dp2[0] = -2*a[1];
    for (int i = 1, it = 1; i <= n; i++) {
        while (2 * (a[i] - a[it]) > T) it++, mdp2 = min(mdp2, dp2[it-2]);
        dp[i] = min(dp[it-1] + T, mdp2 + 2*a[i]);
        dp2[i] = dp[i] - 2 * a[i+1];
    }
    cout << dp[n] + E;
}
