#include <bits/stdc++.h>
using namespace std;
template <class T>
inline void amin(T &x, const T &y) {
  if (y < x) x = y;
}
template <class T>
inline void amax(T &x, const T &y) {
  if (x < y) x = y;
}
template <class T>
struct RMQ {
  int n;
  vector<T> A;
  vector<int> I;
  RMQ(int n_ = 0) : n(n_), A(n), I(2 * n) {
    for (int i = 0; i < n; i++) I[i + n] = i;
    for (int i = n; --i;) I[i] = I[2 * i];
  }
  RMQ(const vector<T> &a) : n(a.size()), A(a), I(2 * n) {
    for (int i = 0; i < n; i++) I[i + n] = i;
    for (int i = n; --i;)
      I[i] = (A[I[i * 2 + 1]] < A[I[i * 2]] ? I[i * 2 + 1] : I[i * 2]);
  }
  void modify(int i, const T &v) {
    A[i] = v;
    for (i += n; i >>= 1;)
      I[i] = (A[I[i * 2 + 1]] < A[I[i * 2]] ? I[i * 2 + 1] : I[i * 2]);
  }
  int min_i(int x, int y) {
    x += n;
    y += n;
    int p = -1;
    for (; x < y; x >>= 1, y >>= 1) {
      if (y & 1) {
        --y;
        if (p < 0 || A[I[y]] < A[p]) p = I[y];
      }
      if (x & 1) {
        if (p < 0 || A[I[x]] < A[p]) p = I[x];
        x++;
      }
    }
    return p;
  }
  T min_v(int x, int y) { return A[min_i(x, y)]; }
};
int N, T, E;
int A[100111];
long long dp[100111];
int main() {
  scanf("%d%d%d", &N, &E, &T);
  for (int i = 0, i_len = (N); i < i_len; ++i) scanf("%d", A + i + 1);
  RMQ<long long> X1(N + 10), X2(N + 10);
  X1.modify(0, -2 * A[1]);
  int mid = 0;
  long long cst = 0;
  for (int i = 1; i <= N; i++) {
    while (mid < i && 2LL * (A[i] - A[mid + 1]) > T) mid++;
    cst = 1LL << 60;
    if (0 < mid) amin(cst, X1.min_v(0, mid) + 3LL * A[i]);
    if (min(i - 1, mid) < i) amin(cst, X2.min_v(min(i - 1, mid), i) + T + A[i]);
    X1.modify(i, cst - 2 * A[i + 1] + A[i]);
    X2.modify(i, cst - A[i]);
  }
  long long ans = cst + E - A[N];
  printf("%lld\n", ans);
  return 0;
}
