#include <bits/stdc++.h>
using namespace std;
using int64 = long long;
const int64 INF = 1LL << 60;
struct SegNode {
  int64 v;
  SegNode(int v) : v(v) {}
  SegNode operator*(const SegNode &r) const { return (v < r.v ? *this : r); }
} e(INF);
struct SegmentTree {
  int sz;
  vector<SegNode> seg;
  SegmentTree(int n) {
    sz = 1;
    while (sz < n) sz <<= 1;
    seg.assign(2 * sz - 1, e);
  }
  void update(int k, const SegNode &x) {
    k += sz - 1;
    seg[k] = x;
    while (k > 0) {
      k = (k - 1) >> 1;
      seg[k] = seg[2 * k + 1] * seg[2 * k + 2];
    }
  }
  SegNode query(int a, int b, int k, int l, int r) {
    if (a >= r || b <= l) return (e);
    if (a <= l && r <= b) return (seg[k]);
    return (query(a, b, 2 * k + 1, l, (l + r) >> 1) *
            query(a, b, 2 * k + 2, (l + r) >> 1, r));
  }
  SegNode query(int a, int b) { return (query(a, b, 0, 0, sz)); }
};
int main() {
  int64 N, E, T, X[100001] = {};
  cin >> N >> E >> T;
  for (int i = 0; i < N; i++) {
    cin >> X[i];
  }
  X[N] = E;
  vector<int64> dp1(N + 1, INF);
  SegmentTree seg1(N + 1), seg2(N + 1);
  auto update = [&](int idx, int64 cost) {
    if (dp1[idx] > cost) {
      dp1[idx] = cost;
      seg1.update(idx, dp1[idx] - X[idx]);
    }
  };
  update(0, X[0]);
  int ptr = 0;
  for (int i = 1; i <= N; i++) {
    while (ptr <= N && (X[i - 1] - X[ptr]) * 2 > T) ++ptr;
    for (int j = i - 1; j >= ptr; j--) {
      int64 need = dp1[j] - X[j] + T;
      dp1[i] = min(dp1[i], need + X[i]);
    }
    for (int j = ptr - 1; j >= 0; j--) {
      int64 need = 2 * (X[i - 1] - X[j]);
      need = dp1[j] - X[j] + 2 * (X[i - 1] - X[j]);
      dp1[i] = min(dp1[i], need + X[i]);
    }
  }
  cout << dp1.back() << endl;
}
