#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using ld = long double;
using ui32 = unsigned int;
constexpr ll INFLL = 1e18;
class SegmentTree {
 public:
  SegmentTree(int n) : n_(n), tree_(5 * n + 1, INFLL) {}
  void update(int pos, ll value) { update_impl(pos, value, 1, 0, n_); }
  ll get(int l, int r) { return get_impl(l, r, 1, 0, n_); }

 private:
  void update_impl(int pos, ll value, int v, int l, int r) {
    if (l == r) {
      tree_[v] = value;
    } else {
      int m = (l + r) / 2;
      if (pos <= m) {
        update_impl(pos, value, v * 2, l, m);
      } else {
        update_impl(pos, value, v * 2 + 1, m + 1, r);
      }
      tree_[v] = min(tree_[v * 2], tree_[v * 2 + 1]);
    }
  }
  ll get_impl(int l, int r, int tv, int tl, int tr) {
    if (r < tl || l > tr) {
      return INFLL;
    }
    if (l == tl && r == tr) {
      return tree_[tv];
    }
    int tm = (tl + tr) / 2;
    return min(get_impl(l, min(tm, r), tv * 2, tl, tm),
               get_impl(max(tm + 1, l), r, tv * 2 + 1, tm + 1, tr));
  }

 private:
  int n_;
  vector<ll> tree_;
};
void solve() {
  int n;
  ll e, t;
  cin >> n >> e >> t;
  vector<ll> x(n + 1, 0);
  for (int i = 1; i <= n; i++) {
    cin >> x[i];
  }
  vector<ll> dp(n + 1, INFLL);
  dp[0] = 0;
  SegmentTree first_case(n);
  SegmentTree second_case(n);
  first_case.update(0, 0 - 2 * x[1] - x[0]);
  second_case.update(0, 0 - x[0]);
  for (int i = 1; i <= n; i++) {
    int k = lower_bound(x.begin(), x.end(), (2 * x[i] - t) / 2) - x.begin();
    if (k > i - 1) {
      k = i - 1;
    }
    dp[i] = min(dp[i], first_case.get(0, k - 1) + 3 * x[i]);
    dp[i] = min(dp[i], second_case.get(k, i - 1) + x[i] + t);
    if (i < n) {
      first_case.update(i, dp[i] - 2 * x[i + 1] - x[i]);
      second_case.update(i, dp[i] - x[i]);
    }
  }
  cout << dp[n] + e - x[n] << "\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int t = 1;
  for (int i = 1; i <= t; i++) {
    solve();
  }
  return 0;
}
