#include <bits/stdc++.h>
using namespace std;
template <typename Monoid>
struct SegmentTree {
  using F = function<Monoid(Monoid, Monoid)>;
  int sz;
  vector<Monoid> seg;
  const F f;
  const Monoid M1;
  SegmentTree(int n, const F f, const Monoid &M1) : f(f), M1(M1) {
    sz = 1;
    while (sz < n) sz <<= 1;
    seg.assign(2 * sz, M1);
  }
  void set(int k, const Monoid &x) { seg[k + sz] = x; }
  void build() {
    for (int k = sz - 1; k > 0; k--) {
      seg[k] = f(seg[2 * k + 0], seg[2 * k + 1]);
    }
  }
  void update(int k, const Monoid &x) {
    k += sz;
    seg[k] = x;
    while (k >>= 1) {
      seg[k] = f(seg[2 * k + 0], seg[2 * k + 1]);
    }
  }
  Monoid query(int a, int b) {
    Monoid L = M1, R = M1;
    for (a += sz, b += sz; a < b; a >>= 1, b >>= 1) {
      if (a & 1) L = f(L, seg[a++]);
      if (b & 1) R = f(seg[--b], R);
    }
    return f(L, R);
  }
  Monoid operator[](const int &k) const { return seg[k + sz]; }
};
int main() {
  int n;
  cin >> n;
  long long e, t;
  cin >> e >> t;
  e *= 2;
  t *= 2;
  long long x[100005];
  x[0] = 0;
  for (int i = 1; i <= n; i++) {
    cin >> x[i];
    x[i] *= 2;
  }
  x[n + 1] = e;
  SegmentTree<long long> seg(
      n + 1, [](long long a, long long b) { return max(a, b); }, 0ll);
  long long dp[100005];
  for (int i = 0; i <= n; i++) {
    if (i == 0) dp[0] = x[1] * 2;
    int l = upper_bound(x, x + n + 2, x[i] - t / 2) - x - 1;
    if (l > 0) dp[i] = max(dp[i], seg.query(0, l) + (x[i + 1] - x[i]) * 2);
    seg.update(i, dp[i]);
    if (i == n) break;
    int j = upper_bound(x, x + n + 2, x[i + 1] + t / 2) - x - 1;
    j = min(j, n);
    dp[j] = max(dp[j], dp[i] + (x[j + 1] - x[j]) * 2 - (x[i + 1] + t - x[j]));
  }
  cout << (e * 3 - dp[n]) / 2 << endl;
}
