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

 public:
  LazySegmentTree(vector<long long> v) {
    int sz = (int)v.size();
    n = 1;
    while (n < sz) n *= 2;
    node.resize(2 * n - 1);
    lazy.resize(2 * n - 1, 0);
    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[i * 2 + 1], node[i * 2 + 2]);
  }
  void eval(int k, int l, int r) {
    if (lazy[k] != 0) {
      node[k] += lazy[k];
      if (r - l > 1) {
        lazy[2 * k + 1] += lazy[k] / 2;
        lazy[2 * k + 2] += lazy[k] / 2;
      }
      lazy[k] = 0;
    }
  }
  void add(int a, int b, long long x, int k = 0, int l = 0, int r = -1) {
    if (r < 0) r = n;
    eval(k, l, r);
    if (b <= l || r <= a) return;
    if (a <= l && r <= b) {
      lazy[k] += (r - l) * x;
      eval(k, l, r);
    } else {
      add(a, b, x, 2 * k + 1, l, (l + r) / 2);
      add(a, b, x, 2 * k + 2, (l + r) / 2, r);
      node[k] = min(node[2 * k + 1], node[2 * k + 2]);
    }
  }
  long long getmin(int a, int b, int k = 0, int l = 0, int r = -1) {
    if (r < 0) r = n;
    eval(k, l, r);
    if (b <= l || r <= a) 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;
  }
  LazySegmentTree seg1(vector<long long>(N + 1, 0)),
      seg2(vector<long long>(N + 1, 0));
  X[N + 2] = E;
  dp[0] = X[1];
  seg1.add(0, 1, dp[0]);
  seg2.add(0, 1, dp[0]);
  for (int i = 1; i <= N; i++) {
    int id = lower_bound(X.begin(), X.end(), X[i] - T / 2) - X.begin();
    dp[i] = dp[i - 1] + T + X[i + 1] - X[i];
    if (id != i) dp[i] = min(dp[i], seg2.getmin(id, i) + T + X[i + 1] - X[i]);
    if (id > 1) dp[i] = min(dp[i], seg1.getmin(0, id - 1) + X[i + 1] - X[i]);
    seg1.add(i, i + 1, dp[i]);
    seg1.add(0, i, 3 * (X[i + 1] - X[i]));
    seg2.add(i, i + 1, dp[i]);
    seg2.add(0, i, X[i + 1] - X[i]);
  }
  cout << dp[N] << endl;
}
