#include <bits/stdc++.h>
using namespace std;
const long long INF = 1ll << 60;
template <typename T>
struct ST {
  vector<T> seg;
  int size;
  ST(int n) {
    size = 1;
    while (size < n) size *= 2;
    seg.resize(2 * size - 1, INF);
  }
  inline T merge(T x, T y) { return min(x, y); }
  void update(int k, T a) {
    k += size - 1;
    seg[k] = a;
    while (k > 0) {
      k = (k - 1) / 2;
      seg[k] = merge(seg[k * 2 + 1], seg[k * 2 + 2]);
    }
  }
  T query(int a, int b, int k, int l, int r) {
    if (r <= a || b <= l) return INF;
    if (a <= l && r <= b) return seg[k];
    T vl = query(a, b, k * 2 + 1, l, (l + r) / 2);
    T vr = query(a, b, k * 2 + 2, (l + r) / 2, r);
    return merge(vl, vr);
  }
  T query(int a, int b) { return query(a, b, 0, 0, size); }
};
const int MAXN = 100100;
int N, E, T;
int X[MAXN];
long long dp[MAXN];
int main() {
  cin >> N >> E >> T;
  for (int i = 0; i < N; i++) cin >> X[i];
  const long long INF = 1ll << 60;
  ST<long long> seg(N + 10);
  for (int i = 0; i <= N; i++) {
    dp[i] = INF;
  }
  X[N] = E;
  dp[N] = 0;
  seg.update(N, dp[N] + X[N] + 2 * X[N - 1]);
  for (int i = N - 1; i >= 0; i--) {
    int low = i, high = N;
    while (high - low > 1) {
      const int med = (low + high) / 2;
      if (2 * (X[med] - X[i]) <= T) {
        low = med;
      } else {
        high = med;
      }
    }
    dp[i] = dp[low + 1] + X[low + 1] - X[i] + T;
    dp[i] = min(dp[i], seg.query(low + 1, N) - 3 * X[i]);
    if (i) seg.update(i, dp[i + 1] + 2 * X[i] + X[i + 1]);
  }
  cout << X[0] + dp[0] << endl;
  return 0;
}
