#include <bits/stdc++.h>
using namespace std;
template <typename T>
struct segtree {
  int n;
  T UNIT;
  vector<T> dat;
  segtree(int n_, T unit) {
    UNIT = unit;
    n = 1;
    while (n < n_) n *= 2;
    dat = vector<T>(2 * n);
    for (int i = 0; i < 2 * n; i++) dat[i] = UNIT;
  }
  T calc(T a, T b) {
    T ans;
    ans = min(a, b);
    return ans;
  }
  void insert(int k, T a) { dat[k + n - 1] = a; }
  void update_all() {
    for (int i = n - 2; i >= 0; i--) {
      dat[i] = calc(dat[i * 2 + 1], dat[i * 2 + 2]);
    }
  }
  void update(int k, T a) {
    k += n - 1;
    dat[k] = a;
    while (k > 0) {
      k = (k - 1) / 2;
      dat[k] = calc(dat[k * 2 + 1], dat[k * 2 + 2]);
    }
  }
  T query(int a, int b, int k = 0, int l = 0, int r = -1) {
    if (r < 0) r = n;
    if (r <= a || b <= l) return UNIT;
    if (a <= l && r <= b)
      return dat[k];
    else {
      T vl = query(a, b, k * 2 + 1, l, (l + r) / 2);
      T vr = query(a, b, k * 2 + 2, (l + r) / 2, r);
      return calc(vl, vr);
    }
  }
};
long long N, E, T;
long long x[100001];
long long x_[100001];
long long dp[100001];
const long long INF = 1e+18;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout << setprecision(10) << fixed;
  cin >> N >> E >> T;
  x[0] = 0;
  for (int i = 0; i < N; i++) {
    cin >> x[i + 1];
    x_[i + 1] = x[i + 1] * 2;
  }
  dp[0] = 0;
  segtree<long long> sgt1(N + 1, INF), sgt2(N + 1, INF);
  sgt1.update(0, dp[0] - x[0]);
  sgt2.update(0, dp[0] - x[0] - 2 * x[1]);
  for (int i = 1; i <= N; i++) {
    auto p = lower_bound(x_, x_ + N + 1, x_[i] - T);
    int j = p - x_;
    long long tmp1 = INF, tmp2 = INF;
    tmp1 = sgt2.query(0, min(j - 1, i - 1)) + x[i] * 3;
    if (j != i)
      tmp2 = sgt1.query(j, i) + x[i] + T;
    else
      tmp2 = dp[i - 1] + x[i] - x[i - 1] + T;
    dp[i] = min(tmp1, tmp2);
    if (i != N) {
      sgt1.update(i, dp[i] - x[i]);
      sgt2.update(i, dp[i] - x[i] - 2 * x[i + 1]);
    }
  }
  cout << dp[N] + E - x[N] << endl;
}
