#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
const long long INF = (long long)1000000007 * 1000000007;
const long double eps = 1e-8;
const long double pi = acos(-1.0);
const int mn = 1 << 17;
long long dp[mn], x[mn];
int n, nn;
long long dat[2][mn];
void init() {
  nn = 1;
  while (nn < n) nn *= 2;
  for (int i = 0; i < 2 * nn - 1; i++) dat[0][i] = dat[1][i] = INF;
}
void update(int id, int k, long long a) {
  k += nn - 1;
  dat[id][k] = a;
  while (k > 0) {
    k = (k - 1) / 2;
    dat[id][k] = min(dat[id][k * 2 + 1], dat[id][k * 2 + 2]);
  }
}
long long query(int id, int a, int b, int k, int l, int r) {
  if (r <= a || b <= l) return INF;
  if (a <= l && r <= b)
    return dat[id][k];
  else {
    long long vl = query(id, a, b, k * 2 + 1, l, (l + r) / 2);
    long long vr = query(id, a, b, k * 2 + 2, (l + r) / 2, r);
    return min(vl, vr);
  }
}
int main() {
  cin >> n;
  init();
  long long e, t;
  cin >> t >> e;
  for (int i = 0; i < n; i++) {
    cin >> x[i];
  }
  x[n] = t;
  fill(dp, dp + n + 2, INF);
  dp[0] = x[0];
  update(0, 0, 0);
  update(1, 0, -2 * x[0]);
  for (int i = 1; i <= n; i++) {
    int loc = lower_bound(x, x + n + 1, x[i - 1] - e / 2) - x;
    long long mi1 = query(1, 0, loc, 0, 0, nn) + x[i] + 2 * x[i - 1];
    long long mi2 = query(0, loc, i, 0, 0, nn) + e + x[i];
    dp[i] = min(mi1, mi2);
    update(0, i, dp[i] - x[i]);
    update(1, i, dp[i] - 3 * x[i]);
  }
  cout << dp[n] << endl;
  return 0;
}
