#include <bits/stdc++.h>
using namespace std;
template <typename T>
struct SegmentTree {
  using F = function<T(T, T)>;
  long long n;
  F f;
  T ti;
  vector<T> dat;
  SegmentTree(){};
  SegmentTree(F f, T ti) : f(f), ti(ti) {}
  SegmentTree(F f, T ti, long long n_) : f(f), ti(ti) {
    n = 1;
    while (n < n_) n <<= 1;
    dat.assign(n << 1, ti);
  }
  SegmentTree(F f, T ti, const vector<T> &v) : f(f), ti(ti) {
    long long n_ = v.size();
    n = 1;
    while (n < n_) n <<= 1;
    dat.assign(n << 1, ti);
    for (long long i = 0; i < n_; i++) dat[n + i] = v[i];
    for (long long i = n - 1; i; i--)
      dat[i] = f(dat[(i << 1) | 0], dat[(i << 1) | 1]);
  }
  T get(long long x) { return dat[x + n]; }
  void init(long long n_) {
    n = 1;
    while (n < n_) n <<= 1;
    dat.assign(n << 1, ti);
  }
  void build(const vector<T> &v) {
    long long n_ = v.size();
    init(n_);
    for (long long i = 0; i < n_; i++) dat[n + i] = v[i];
    for (long long i = n - 1; i; i--)
      dat[i] = f(dat[(i << 1) | 0], dat[(i << 1) | 1]);
  }
  void set_val(long long k, T x) {
    dat[k += n] = x;
    while (k >>= 1) dat[k] = f(dat[(k << 1) | 0], dat[(k << 1) | 1]);
  }
  T query(long long a, long long b) {
    T vl = ti, vr = ti;
    for (long long l = a + n, r = b + n; l < r; l >>= 1, r >>= 1) {
      if (l & 1) vl = f(vl, dat[l++]);
      if (r & 1) vr = f(dat[--r], vr);
    }
    return f(vl, vr);
  }
  template <typename C>
  long long find(long long st, C &check, T &acc, long long k, long long l,
                 long long r) {
    if (l + 1 == r) {
      acc = f(acc, dat[k]);
      return check(acc) ? k - n : -1;
    }
    long long m = (l + r) >> 1;
    if (m <= st) return find(st, check, acc, (k << 1) | 1, m, r);
    if (st <= l && !check(f(acc, dat[k]))) {
      acc = f(acc, dat[k]);
      return -1;
    }
    long long vl = find(st, check, acc, (k << 1) | 0, l, m);
    if (~vl) return vl;
    return find(st, check, acc, (k << 1) | 1, m, r);
  }
  template <typename C>
  long long find(long long st, C &check) {
    T acc = ti;
    return find(st, check, acc, 1, 0, n);
  }
};
const long long INF = 1e9;
auto f = [](long long a, long long b) { return min(a, b); };
template <typename T>
void fin(T a) {
  cout << a << endl;
  exit(0);
}
signed main() {
  long long n, e, t;
  cin >> n >> e >> t;
  vector<long long> x(n + 1, 0);
  for (long long i = 0; i < n; i++) cin >> x[i + 1];
  SegmentTree<long long> seg1(f, INF, n), seg2(f, INF, n);
  seg1.set_val(0, -2 * x[1]);
  seg2.set_val(0, 0);
  for (long long i = 1; i < n + 1; i++) {
    long long l = -1, r = i;
    while (r - l > 1) {
      long long mid = (l + r) >> 1;
      (2 * (x[i] - x[mid]) > t ? l : r) = mid;
    }
    long long a = min(seg1.query(0, l) + 3 * x[i], seg2.query(l, i) + x[i] + t);
    if (i < n) {
      seg1.set_val(i, -2 * x[i + 1] - x[i] + a);
      seg2.set_val(i, a - x[i]);
    } else
      fin(e - x[n] + a);
  }
}
