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

#define int long long
const double PI = 3.14159265358979323846;
typedef vector<int> vint;
typedef pair<int, int> pint;
int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
// cout << fixed << setprecision(20);

int N, E, T;
int x[110000], dp[110000];
signed main() {
    cin >> N >> E >> T;
    for (int i = 0; i < N; i++)cin >> x[i];
    x[N] = E;
    dp[N] = 0;
    int rmin = 1e14;
    int lidx = N;
    for (int i = N - 1; i >= 0; i--) {
        rmin += 2 * (x[i + 1] - x[i]);
        while (T < 2 * (x[lidx - 1] - x[i]))rmin = min(rmin, dp[lidx] + 2 * (x[lidx - 1] - x[i])), lidx--;
        dp[i] = min(rmin, dp[lidx] + T);
    }
    cout << E + dp[0] << endl;;
}
