#include <bits/stdc++.h>
using namespace std;
template <class T, class T2>
inline void chkmax(T &x, const T2 &y) {
  if (x < y) x = y;
}
template <class T, class T2>
inline void chkmin(T &x, const T2 &y) {
  if (x > y) x = y;
}
const int MAXN = (1 << 20);
template <class T>
struct monotonous_queue_min {
  int len;
  deque<pair<T, int> > Q;
  monotonous_queue_min() {
    Q.clear();
    len = 0;
  }
  void init(int _l) {
    len = _l;
    Q.clear();
  }
  void push_back(T x, int X) {
    while (!Q.empty() && X - Q.front().second > len) Q.pop_front();
    while (!Q.empty() && x <= Q.back().first) Q.pop_back();
    Q.push_back({x, X});
  }
  T query() {
    if (Q.empty()) return (T)1e18;
    return Q.front().first;
  }
};
int64_t n, t, e, L;
int64_t x[MAXN];
void read() {
  cin >> n >> e >> t;
  for (int i = 1; i <= n; i++) cin >> x[i];
}
int64_t dp[MAXN];
int64_t mn[MAXN];
monotonous_queue_min<int64_t> mq;
void solve() {
  x[0] = 0;
  dp[0] = 0;
  mn[0] = (int64_t)1e18;
  L = t / 2;
  mq.init(L);
  int last = 0;
  for (int i = 1; i <= n; i++) {
    mn[i] = min(mn[i - 1], dp[i - 1] - x[i] * 2 - x[i - 1]);
    mq.push_back(dp[i - 1] - x[i - 1], x[i]);
    dp[i] = mq.query() + t - 2 * x[i];
    while (i >= last && (x[i] - x[last]) > L) last++;
    chkmin(dp[i], mn[last - 1]);
    dp[i] += 3ll * x[i];
  }
  cout << dp[n] + e - x[n] << '\n';
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  read();
  solve();
  return 0;
}
