#include <bits/stdc++.h>
using namespace std;
int F() {
  char ch;
  int x, a;
  while (ch = getchar(), (ch < '0' || ch > '9') && ch != '-')
    ;
  if (ch == '-')
    ch = getchar(), a = -1;
  else
    a = 1;
  x = ch - '0';
  while (ch = getchar(), ch >= '0' && ch <= '9')
    x = (x << 1) + (x << 3) + ch - '0';
  return a * x;
}
const int MaxN = 1e5 + 10;
int N, E, T, x[MaxN];
long long f[MaxN];
int find(int i) {
  int j = i;
  for (int k = 18; ~k; --k)
    if ((j - (1 << k)) >= 0 && 2 * (x[i] - x[j - (1 << k) + 1]) <= T)
      j -= 1 << k;
  return j;
}
struct zkw {
  long long s[MaxN << 2];
  int cnt;
  void build() {
    cnt = 1;
    for (; cnt < N + 3; cnt <<= 1)
      ;
    --cnt;
    for (int i = 1; i <= N + 1; ++i) s[cnt + i] = 1e18;
    for (int i = cnt; i; --i) s[i] = 1e18;
  }
  void modify(int pos, long long x) {
    ++pos;
    pos += cnt;
    s[pos] = min(s[pos], x);
    for (pos >>= 1; pos; pos >>= 1) s[pos] = min(s[pos << 1], s[pos << 1 | 1]);
  }
  long long query(int l, int r) {
    long long ans = 1e18;
    ++l, ++r;
    for (l += cnt - 1, r += cnt + 1; l ^ r ^ 1; l >>= 1, r >>= 1) {
      if (~l & 1) ans = min(ans, s[l ^ 1]);
      if (r & 1) ans = min(ans, s[r ^ 1]);
    }
    return ans;
  }
} s1, s2;
int main() {
  ((((N) = F()), ((E) = F())), ((T) = F()));
  for (int i = 1; i <= N; ++i) ((x[i]) = F()), f[i] = 1e18;
  s1.build(), s2.build();
  s1.modify(0, 0);
  s2.modify(0, 0);
  for (int i = 1; i <= N; ++i) {
    int k = find(i);
    f[i] = min(f[i], s1.query(0, k - 1) + 3LL * x[i]);
    f[i] = min(f[i], s2.query(k, i - 1) + x[i] + T);
    s1.modify(i, f[i] - x[i] - 2 * x[i + 1]);
    s2.modify(i, f[i] - x[i]);
  }
  f[N] += E - x[N];
  printf("%lld\n", f[N]);
  return 0;
}
