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

#define ll long long

const ll MAX = 1e5 + 10, inf = 1e17+1;

ll n, e, t, dp[MAX], x[MAX], p[MAX];

int main()
{
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    fill (dp, dp+MAX, inf);
    fill (p, p+MAX, inf);
    cin >> n >> e >> t;
    for (int i = 0; i < n; i++)
        cin >> x[i + 1];
    dp[0] = 0;
    p[0] = -2 * x[1];
    for (int i = 1; i <= n; i++)
    {
        int j = lower_bound(x + 1, x + n + 1, x[i] - t / 2) - x;
        j--;
        if (j > 0)
            dp[i] = p[j-1] + 2 * x[i];
        dp[i] = min(dp[i], dp[j] + t);
        p[i] = min(p[i-1], dp[i] - 2 * x[i+1]);
        //cout << i << " " << j << " " << dp[i] << " " << p[i] << "\n";
    }
    cout << dp[n] + e  << endl;
    return 0;
}
