#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007ll;
const double EPS = 1e-11;
int n, e;
long long t;
int x[252521];
long long dp[252521];
constexpr long long INF = 1e18;
inline long long calc(int i, int j) {
  return dp[j + 1] + max(t, 2 * (long long)(x[j] - x[i]));
}
struct RMQ {
  int n;
  vector<long long> dat;
  RMQ(int _n) {
    n = 1;
    while (n < _n) n <<= 1;
    dat.assign(2 * n, INF);
  }
  void set(int x, int v) {
    x += n - 1;
    dat[x] = v;
    while (x != 0) {
      x = (x - 1) / 2;
      dat[x] = min(dat[2 * x + 1], dat[2 * x + 2]);
    }
  }
  long long qmin(int l, int r, int a, int b, int k) {
    if (r <= a || b <= l) return INF;
    if (l <= a && b <= r) {
      return dat[k];
    } else {
      int m = (a + b) / 2;
      return min(qmin(l, r, a, m, 2 * k + 1), qmin(l, r, m, b, 2 * k + 2));
    }
  }
  long long qmin(int l, int r) { return qmin(l, r, 0, n, 0); }
};
int main() {
  scanf("%d%d%lld", &n, &e, &t);
  for (int i = 0; i < (int)(n); ++i) scanf("%d", x + i);
  x[n] = e;
  for (int i = 0; i < (int)(n); ++i) dp[i] = -1;
  dp[n] = 0;
  long long ans = e;
  RMQ aa(n), bb(n);
  for (int i = (int)(n)-1; i >= (int)(0); --i) {
    aa.set(i, 2ll * x[i] + dp[i + 1]);
    bb.set(i, t + dp[i + 1]);
    int m =
        upper_bound(x + i, x + n + 1, (long long)(t + 2ll * x[i]) / 2ll) - x;
    m--;
    long long xx = aa.qmin(m + 1, n) - 2ll * x[i];
    long long yy = bb.qmin(0, m + 1);
    dp[i] = min(xx, yy);
  }
  printf("%lld\n", ans + dp[0]);
  return 0;
}
