#include <bits/stdc++.h>
using namespace std;
template <class V, int NV>
class SegTree {
 public:
  static V const def = -(1LL << 60);
  V comp(V l, V r) { return max(l, r); };
  vector<V> val;
  SegTree() { val = vector<V>(NV * 2, def); }
  V getval(int l, int r) {
    l += NV;
    r += NV + 1;
    V ret = def;
    while (l < r) {
      if (l & 1) ret = comp(ret, val[l++]);
      if (r & 1) ret = comp(ret, val[--r]);
      l /= 2;
      r /= 2;
    }
    return ret;
  }
  void update(int i, V v) {
    i += NV;
    val[i] = v;
    while (i > 1) i >>= 1, val[i] = comp(val[i * 2], val[i * 2 + 1]);
  }
};
int N;
long long E, T;
long long X[101010];
long long Y[101010];
long long YY[101010];
long long dp[101010][2];
SegTree<long long, 1 << 20> st;
int main() {
  cin >> N >> E >> T;
  for (int i = 0; i < N; i++) scanf("%d", &X[i]);
  X[N] = E;
  Y[0] = X[0];
  for (int i = 0; i < N; i++) Y[i + 1] = X[i + 1] - X[i];
  YY[0] = Y[0];
  for (int i = 1; i < N + 1; i++) YY[i] = Y[i] + YY[i - 1];
  for (int i = 0; i < N + 1; i++) dp[i][0] = dp[i][1] = 1LL << 60;
  dp[0][0] = Y[0];
  dp[0][1] = Y[0] + T;
  st.update(0, dp[0][0] - YY[0] * 3);
  for (int i = 1; i < N + 1; i++) {
    dp[i][0] = min(dp[i][0], dp[i - 1][0] + Y[i] + T);
    dp[i][0] = min(dp[i][0], dp[i - 1][1] + Y[i]);
    dp[i][1] = min(dp[i][1], dp[i - 1][0] + Y[i] + T * 2);
    dp[i][1] = min(dp[i][1], dp[i - 1][1] + Y[i] + T);
    dp[i][1] = min(dp[i][1], YY[i] * 3 + st.getval(0, i - 1));
    st.update(i, dp[i][0] - YY[i] * 3);
  }
  cout << dp[N][0] << endl;
}
