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

const long long maxn = 1e5 + 10 , inf = 2e18;
long long e , n , t , x[maxn] , dp[maxn] , p[maxn];

int main()
{
    cin >> n >> e >> t;
    for(int i=1 ; i<=n ; i++) cin >> x[i];
    dp[0] = 0; p[0] = dp[0] - 2*x[1];
    for(int i=1 ; i<=n ; i++)
    {
        int y = lower_bound(x,x+n , x[i]-(t/2))-x;
        dp[i] = (y <= 1 ? t : min(p[y-2] + 2*x[i] , dp[y-1] + t));
        p[i] = min(p[i-1] , dp[i] - 2*(x[i+1]));
    }
    cout << dp[n] + e;
}