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

#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define eb emplace_back

typedef long long ll;
typedef pair<int, int> pi;

const int maxn = 1e5 + 5;
ll dp[maxn];
ll pre1[maxn];
ll x[maxn];

int n;
ll T, E;

int main(){
    ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    cin >> n >> E >> T;
    for(int i = 1;i <= n;i++){
        cin >> x[i];
    }
    dp[0] = 0;
    pre1[0] = dp[0] - 2 * x[1];
    int l = -1;
    for(int i = 1;i <= n;i++){
        while(l + 1 < i and 2 * (x[i] - x[l + 2]) >= T){
            l++;
        }
        dp[i] = 1e18;
        if(l >= 0)
            dp[i] = pre1[l] + 2 * x[i];
        if(l + 1 < i){
            dp[i] = min(dp[i], dp[l + 1] + T);
        }
        pre1[i] = pre1[i - 1];
        pre1[i] = min(pre1[i - 1], dp[i] - 2 * x[i + 1]);
    }
    cout << E + dp[n] << endl;
    return 0;
}
