#include <bits/stdc++.h>
using namespace std;
template <class T>
class RMQ {
  int n;
  vector<T> A;
  T q(int l, int r) {
    T a = min(A[l], A[r - 1]);
    if ((l + 1) / 2 < r / 2) a = min(a, q((l + 1) / 2, r / 2));
    return a;
  }

 public:
  RMQ(int n_) {
    n = 1;
    while (n < n_) n *= 2;
    A = vector<T>(2 * n, numeric_limits<T>::max());
  }
  void set(int i, T v) {
    A[i + n] = v;
    for (int p = (i + n) / 2; p > 0; p /= 2) A[p] = min(A[2 * p], A[2 * p + 1]);
  }
  T query(int l, int r) { return q(l + n, r + n); }
};
int main() {
  int N, E, T;
  cin >> N >> E >> T;
  vector<int> x(N);
  for (int &t : x) cin >> t;
  vector<long long> A(N);
  A[0] = x[0] + T;
  RMQ<long long> Q1(N);
  RMQ<long long> Q2(N);
  for (int i = 1; i < N; i++) {
    A[i] = A[i - 1] + (x[i] - x[i - 1]) + T;
    A[i] = min(A[i],
               0LL + x[0] + (x[i] - x[0]) * 3 + max(0, T - (x[i] - x[0]) * 2));
    int l = 0;
    int r = i + 1;
    while (l + 1 < r) {
      int m = (l + r) / 2;
      if ((x[i] - x[m]) * 2 > T)
        l = m;
      else
        r = m;
    }
    if (1 < r) A[i] = min(A[i], 3 * x[i] + Q1.query(1, r));
    if (r < i) A[i] = min(A[i], T + x[i] + Q2.query(r, i));
    Q1.set(i, A[i - 1] - x[i - 1] - 2 * x[i]);
    Q2.set(i, A[i - 1] - x[i - 1]);
  }
  cout << A[N - 1] + E - x[N - 1] << endl;
}
