#include <bits/stdc++.h>
using namespace std;
template <class S, class T>
pair<S, T> operator+(const pair<S, T> &s, const pair<S, T> &t) {
  return pair<S, T>(s.first + t.first, s.second + t.second);
}
template <class S, class T>
pair<S, T> operator-(const pair<S, T> &s, const pair<S, T> &t) {
  return pair<S, T>(s.first - t.first, s.second - t.second);
}
template <class S, class T>
ostream &operator<<(ostream &os, pair<S, T> p) {
  os << "(" << p.first << ", " << p.second << ")";
  return os;
}
template <class T>
bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
bool chmin(T &a, const T &b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
const long long inf = 1000000001;
const long long INF = (long long)1e18 + 1;
const long double pi = 3.1415926535897932384626433832795028841971L;
vector<int> dx = {1, 0, -1, 0}, dy = {0, 1, 0, -1};
const long long MOD = 998244353;
template <typename T>
class SegmentTree {
 public:
  using F = function<T(T &, T &)>;
  int n;
  vector<T> dat;
  T e;
  F query_func;
  F update_func;
  SegmentTree(vector<T> a, F query_func, F update_func, T e)
      : n(a.size()), query_func(query_func), update_func(update_func), e(e) {
    dat.resize(4 * n);
    init(0, 0, n, a);
  }
  void init(int k, int l, int r, vector<T> &a) {
    if (r - l == 1) {
      dat[k] = a[l];
    } else {
      int lch = 2 * k + 1, rch = 2 * k + 2;
      init(lch, l, (l + r) / 2, a);
      init(rch, (l + r) / 2, r, a);
      dat[k] = query_func(dat[lch], dat[rch]);
    }
  }
  void update(int k, T a, int v, int l, int r) {
    if (r - l == 1) {
      dat[v] = update_func(dat[v], a);
    } else {
      if (k < (l + r) / 2)
        update(k, a, 2 * v + 1, l, (l + r) / 2);
      else {
        update(k, a, 2 * v + 2, (l + r) / 2, r);
      }
      dat[v] = query_func(dat[v * 2 + 1], dat[v * 2 + 2]);
    }
  }
  T query(int a, int b, int k, int l, int r) {
    if (r <= a || b <= l) {
      return e;
    }
    if (a <= l && r <= b) {
      return dat[k];
    } else {
      T ul = query(a, b, k * 2 + 1, l, (l + r) / 2);
      T ur = query(a, b, k * 2 + 2, (l + r) / 2, r);
      return query_func(ul, ur);
    }
  }
  int find(int a, int b, int k, int l, int r, int x) {
    if (dat[k] < x || r <= a || b <= l) return -1;
    if (l + 1 == r) {
      if (dat[k] >= x)
        return l;
      else
        return -1;
    }
    int rv = find(a, b, 2 * k + 2, (l + r) / 2, r, x);
    if (rv != -1) return rv;
    return find(a, b, 2 * k + 1, l, (l + r) / 2, x);
  }
};
signed main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  ;
  long long n, e, t;
  cin >> n >> e >> t;
  vector<long long> x(n + 1);
  for (int i = 1; i <= (int)(n); i++) cin >> x[i];
  auto f = [](long long a, long long b) { return min(a, b); };
  auto g = [](long long, long long b) { return b; };
  SegmentTree<long long> seg(vector<long long>(n + 1, INF), f, g, INF);
  vector<long long> dp(n + 1, INF);
  dp[0] = 0;
  seg.update(0, dp[0] + t - x[0], 0, 0, seg.n);
  long long mi = INF;
  int ki = 0;
  for (int i = 1; i <= (int)(n); i++) {
    int px = x[i] - t / 2 - 1;
    auto itr = upper_bound(x.begin(), x.end(), px);
    itr--;
    int pi = itr - x.begin();
    pi -= 5;
    for (int _ = 0; _ < (int)(10); _++) {
      if (pi >= 0) {
        if ((x[i] - x[pi + 1]) * 2 < t) break;
        chmin(dp[i], dp[pi] + (x[pi + 1] - x[pi]) + (x[i] - x[pi + 1]) * 3);
      }
      pi++;
    }
    cerr << "pi"
         << ": " << pi << endl;
    ;
    long long mi = seg.query(pi, i, 0, 0, seg.n);
    chmin(dp[i], mi + x[i]);
    if (i != n) {
      seg.update(i, dp[i] + t - x[i], 0, 0, seg.n);
    }
  }
  cerr << "dp"
       << ":";
  for (int i = 0; i < dp.size(); i++) cerr << " " << dp[i];
  cerr << endl;
  ;
  cout << dp[n] + e - x[n] << endl;
}
