#include <bits/stdc++.h>
using namespace std;
const long long inf = 1e17;
const long long mod = 1000000007;
long long x[100006];
struct RMQ {
  long long n;
  vector<long long> node;
  void init(long long N) {
    n = 1;
    while (n < N) n *= 2;
    node.resize(2 * n, inf);
  }
  void update(long long x, long long a) {
    x += n - 1;
    node[x] = a;
    while (x > 0) {
      x = (x - 1) / 2;
      node[x] = min(node[x * 2 + 1], node[x * 2 + 2]);
    }
  }
  long long query(long long a, long long b, long long k, long long l,
                  long long r) {
    if (r <= a || b <= l) return inf;
    if (a <= l && r <= b) return node[k];
    long long vl = query(a, b, k * 2 + 1, l, (l + r) / 2);
    long long vr = query(a, b, k * 2 + 2, (l + r) / 2, r);
    return min(vl, vr);
  }
  long long get(long long a, long long b) {
    if (a > b) return inf;
    return query(a, b, 0, 0, n);
  }
};
RMQ dp1, dp2;
signed main() {
  long long n, e, t;
  cin >> n >> e >> t;
  for (long long i = 0; i < n; i++) cin >> x[i];
  dp1.init(n + 2);
  dp2.init(n + 2);
  x[n] = x[n - 1];
  dp1.update(0, 0);
  dp2.update(0, -2 * x[0]);
  for (long long i = 0; i < n; i++) {
    long long lb = -1, ub = i + 1;
    while (ub - lb > 1) {
      long long mi = (ub + lb) / 2;
      if (2 * (x[i] - x[mi]) > t)
        lb = mi;
      else
        ub = mi;
    }
    long long X1, X2;
    X1 = dp1.get(ub, i + 1) + t;
    X2 = dp2.get(0, ub) + 2 * x[i];
    dp1.update(i + 1, min(X1, X2));
    dp2.update(i + 1, dp1.get(i + 1, i + 2) - 2 * x[i]);
  }
  cout << dp1.get(n, n + 1) + e << endl;
}
