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

const int DIM = 200005;

long long pos[DIM], dp1[DIM], dp2[DIM];

int main(void)
{
    int n, e, t;
    cin >> n >> e >> t;
    
    for (int i = 1; i <= n; ++i)
        cin >> pos[i];
    
    dp2[0] = 1e17;
    for (int i = 1, p = 1; i <= n; ++i) {
        while ((pos[i] - pos[p]) * 2 >= t)
            ++p;
        
        dp1[i] = min(dp1[p - 1] + t, dp2[p - 1] + pos[i] * 2);
        dp2[i] = min(dp2[i - 1], dp1[i - 1] - pos[i] * 2);
    }
    
    cout << dp1[n] + e << endl;
    return 0;
}