#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 5;
int n, t, e, x[maxn];
long long f[maxn];
struct Seg {
  long long tr[maxn << 2];
  inline void Upd(int o, int l, int r, int p, long long d) {
    if (l == r) return tr[o] = d, void();
    int mid = (l + r) >> 1;
    if (p <= mid)
      Upd(o << 1, l, mid, p, d);
    else
      Upd(o << 1 | 1, mid + 1, r, p, d);
    tr[o] = min(tr[o << 1], tr[o << 1 | 1]);
  }
  inline long long Ask(int o, int l, int r, int ql, int qr) {
    if (ql > qr) return 1e18;
    if (ql <= l && r <= qr) return tr[o];
    int mid = (l + r) >> 1;
    long long ans = 1e18;
    if (ql <= mid) ans = min(ans, Ask(o << 1, l, mid, ql, qr));
    if (qr > mid) ans = min(ans, Ask(o << 1 | 1, mid + 1, r, ql, qr));
    return ans;
  }
} g, h;
int main() {
  scanf("%d%d%d", &n, &e, &t);
  for (int i = 1; i <= n; ++i) scanf("%d", &x[i]);
  memset(f, 0x3f, sizeof f);
  f[0] = 0, g.Upd(1, 0, n, 0, 0), h.Upd(1, 0, n, 0, -2 * x[1]);
  for (int i = 1; i <= n; ++i) {
    int p = lower_bound(x, x + i, x[i] - t / 2) - x;
    f[i] = min(g.Ask(1, 0, n, p - 1, i - 1) + t + x[i],
               h.Ask(1, 0, n, 0, p - 2) + 3 * x[i]);
    if (i < n)
      g.Upd(1, 0, n, i, f[i] - x[i]),
          h.Upd(1, 0, n, i, f[i] - x[i] - 2 * x[i + 1]);
  }
  printf("%lld\n", f[n] + e - x[n]);
}
