#include <bits/stdc++.h>
using namespace std;
const long long inf = 1e18;
struct SegmentTree {
 private:
  int n;
  vector<long long> node;

 public:
  SegmentTree(vector<long long> v) {
    int sz = v.size();
    n = 1;
    while (n < sz) n *= 2;
    node.resize(2 * n - 1, inf);
    for (int i = 0; i < sz; i++) node[i + n - 1] = v[i];
    for (int i = n - 2; i >= 0; i--)
      node[i] = min(node[2 * i + 1], node[2 * i + 2]);
  }
  void update(int x, long long val) {
    x += (n - 1);
    node[x] = val;
    while (x > 0) {
      x = (x - 1) / 2;
      node[x] = min(node[2 * x + 1], node[2 * x + 2]);
    }
  }
  long long getmin(int a, int b, int k = 0, int l = 0, int r = -1) {
    if (r < 0) r = n;
    if (r <= a || b <= l) return inf;
    if (a <= l && r <= b) return node[k];
    long long vl = getmin(a, b, 2 * k + 1, l, (l + r) / 2);
    long long vr = getmin(a, b, 2 * k + 2, (l + r) / 2, r);
    return min(vl, vr);
  }
};
int N;
long long T, E;
int main() {
  cin >> N >> E >> T;
  vector<long long> X(N + 2, 0), dp(N + 2, 0);
  for (int i = 1; i <= N; i++) {
    cin >> X[i];
    dp[i] = inf;
  }
  SegmentTree seg1(vector<long long>(N + 1, inf)),
      seg2(vector<long long>(N + 1, inf));
  X[N + 1] = E;
  dp[0] = X[1];
  seg1.update(0, dp[0] - X[1]);
  seg2.update(0, dp[0] - 3 * X[1]);
  for (int i = 1; i <= N; i++) {
    dp[i] = dp[i - 1] + X[i + 1] - X[i] + T;
    int id = lower_bound(X.begin(), X.end(), X[i] - T / 2) - X.begin();
    if (id > 0) dp[i] = min(dp[i], seg1.getmin(id - 1, i) + T + X[i + 1]);
    dp[i] = min(dp[i], seg2.getmin(0, id - 1) + 2 * X[i] + X[i + 1]);
    seg1.update(i, dp[i] - X[i + 1]);
    seg2.update(i, dp[i] - 3 * X[i + 1]);
  }
  cout << dp[N] << endl;
}
