#include<bits/stdc++.h>

#define pb push_back
#define mp make_pair
#define taskname "A"

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<int,int> ii;
const int maxn = 1e5 + 10;
int n , T , E;
int a[maxn];
ll dp[maxn];

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    if(fopen(taskname".INP" , "r"))
        freopen(taskname".INP","r",stdin),
        freopen(taskname".OUT","w",stdout);
    cin >> n >> E >> T;
    for(int i = 1 ; i <= n ; ++i)cin >> a[i];
    int j = 0;ll pref = 1e18;
    for(int i = 1 ; i <= n ; ++i){
        dp[i] = 1e18;
        while(j < i && 2 * (a[i] - a[j + 1]) > T){
            pref = min(pref,dp[j]-2*a[j + 1]);
            ++j;
        }
        dp[i] = min(pref+2*a[i],dp[j]+T);
//        cout << dp[i] << " ";
    }
    cout << dp[n] + E;
}
