#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 10;
const long long INF = 1e15 + 10;
int n;
long long x[maxn], e, t;
int ll[maxn], rr[maxn];
long long mini1[maxn], mini2[maxn];
long long dp[maxn];
void build(int p, int l, int r) {
  ll[p] = l;
  rr[p] = r;
  mini1[p] = mini2[p] = INF;
  if (l == r) return;
  build(p << 1, l, (l + r) >> 1);
  build((p << 1) | 1, ((l + r) >> 1) + 1, r);
  return;
}
void update(int p, int pos, long long val, int tp) {
  if (!tp)
    mini1[p] = min(mini1[p], val);
  else
    mini2[p] = min(mini2[p], val);
  if (ll[p] == rr[p]) return;
  if (pos <= rr[p << 1])
    update(p << 1, pos, val, tp);
  else
    update((p << 1) | 1, pos, val, tp);
  return;
}
long long getmini(int p, int l, int r, int tp) {
  if (l > r) return INF;
  if (r < ll[p] || rr[p] < l) return INF;
  if (l <= ll[p] && rr[p] <= r) {
    if (!tp)
      return mini1[p];
    else
      return mini2[p];
  }
  return min(getmini(p << 1, l, r, tp), getmini((p << 1) | 1, l, r, tp));
}
int main() {
  scanf("%d%lld%lld", &n, &e, &t);
  for (int i = 1; i <= n; i++) scanf("%lld", &x[i]);
  x[n + 1] = e;
  dp[0] = x[1];
  build(1, 0, n);
  update(1, 0, dp[0] - x[1], 0);
  update(1, 0, dp[0] - x[1] * 3ll, 1);
  for (int i = 1; i <= n; i++) {
    int tmp = lower_bound(x + 1, x + n + 1, x[i] - (t >> 1)) - x;
    dp[i] = min(getmini(1, 0, tmp - 2, 1) + 3ll * x[i],
                getmini(1, tmp - 1, i - 1, 0) + t + x[i]);
    dp[i] += x[i + 1] - x[i];
    update(1, i, dp[i] - x[i + 1], 0);
    update(1, i, dp[i] - x[i + 1] * 3ll, 1);
  }
  printf("%lld\n", dp[n]);
  return 0;
}
