#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
const int maxn = 1e5 + 100;
const ll inf = 2e18 + 13;

ll dp[maxn] , partial_min[maxn] , a[maxn];

int main()
{
    fill(dp , dp + maxn , inf);
    ll n , e , T;
    cin >> n >> e >> T;
    e *= 2;
    T *= 2;
    for(int i = 1; i <= n; i++)
        cin >> a[i] , a[i] *= 2;
    dp[0] = 0;
    int pt = 0;
    for(int i = 1; i <= n; i++)
    {
        while(pt + 1 < i && a[pt + 1] <= a[i] - T / 2)
            pt++;
        if(!pt)
            dp[i] = T;
        else
            dp[i] = min(dp[pt] + T , partial_min[pt] + a[i] * 2);
        partial_min[i] = min(partial_min[i - 1] , dp[i - 1] - 2 * a[i]);
    }
    cout << (dp[n] + e) / 2 << endl;
}
