#include <bits/stdc++.h>
using namespace std;
const long long inf = 1ll * 1000 * 1000 * 1000 * 1000 * 1000;
const long long N = 1e5 + 10;
long long a[N], nxt[N], n, e, t;
long long val;
long long seg[N << 2], lazy[N << 2], dp[N];
vector<long long> fnd[N];
void relax(long long id) {
  long long lc = id * 2, rc = lc + 1;
  seg[lc] += lazy[id], lazy[lc] += lazy[id];
  seg[rc] += lazy[id], lazy[rc] += lazy[id];
  lazy[id];
  return;
}
void add(long long l, long long r, long long id = 1, long long s = 0,
         long long e = n) {
  if (l == r) return;
  if (l <= s && e <= r) {
    seg[id] += val;
    lazy[id] += val;
    return;
  }
  if (e <= l || r <= s) return;
  long long mid = (s + e) / 2, lc = id * 2, rc = lc + 1;
  relax(id);
  add(l, r, lc, s, mid);
  add(l, r, rc, mid, e);
  seg[id] = min(seg[lc], seg[rc]);
}
void upd(long long p, long long id = 1, long long s = 0, long long e = n) {
  if (e - s == 1) {
    seg[id] = val;
    lazy[id] = 0;
    return;
  }
  long long mid = (s + e) / 2, lc = id * 2, rc = lc + 1;
  if (p < mid)
    upd(p, lc, s, mid);
  else
    upd(p, rc, mid, e);
  seg[id] = min(seg[lc], seg[rc]);
  return;
}
int32_t main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  cin >> n >> e >> t;
  for (long long i = 1; i <= n; i++) cin >> a[i];
  long long st = -1;
  n++;
  for (long long i = 0; i < n; i++) {
    val = inf;
    upd(i);
    while ((a[i] - a[st + 1]) * 2 >= t) st++;
    if (st != -1) fnd[st].push_back(i);
  }
  st = n;
  for (long long i = n - 1; i >= 0; i--) {
    while ((a[st - 1] - a[i]) >= t) st--;
    nxt[i] = st;
  }
  val = t;
  upd(n - 1);
  for (long long i = n - 2; i >= 0; i--) {
    long long toall = a[i + 1] - a[i], tosome = a[i + 2] - a[i + 1];
    val = toall, add(i + 1, n);
    if (tosome > 0) val = tosome, add(nxt[i + 1], n);
    for (auto plc : fnd[i + 1]) {
      long long dis = 1ll * (a[plc] - a[i + 1]) * 3 + 1ll * toall;
      val = dis + dp[plc], upd(plc);
    }
    dp[i] = seg[1], val = dp[i] + t;
    upd(i);
  }
  cout << dp[0] + e - a[n - 1];
  return 0;
}
