#pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>

#define F first
#define S second
#define int long long
#define ll long long
//#define int  unsigned long long
#define pb push_back
//#define double long double

using namespace std;
using namespace __gnu_pbds;
typedef  tree< int , null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
const int mod = 1e9 + 7;
const int N = 200007;
const int K = 5000;
int dp[N], x[N];
main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
   // freopen("input.txt", "r", stdin);
    int n, e, t;
    cin >> n >> e >> t;
    for (int i = 1; i <= n; i++){
        cin >> x[i];
    }
    dp[n] = e - x[n] + t;
    x[n + 1] = e;
    for (int i = n - 1; i >= 1; i--){
        dp[i] = 1e15;
        for (int j = i; j <= n; j++){
            dp[i] = min(dp[i], 3 * (x[j] - x[i]) + x[j + 1] - x[j] + dp[j + 1] + max(t - 2 * x[j] + 2 * x[i], 0LL));
        }
    }
    cout << x[1] + dp[1];
}
