#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int N = 100005, sz = 131072;
const ll INF = ll(1e18);
struct Seg {
  ll d[2 * sz];
  void ini() { fill(d, d + 2 * sz, INF); }
  void upd(int x, ll v) {
    x += sz;
    d[x] = min(d[x], v);
    for (x >>= 1; x; x >>= 1) d[x] = min(d[2 * x], d[2 * x + 1]);
  }
  ll get(int s, int e) {
    ll r = INF;
    for (s += sz, e += sz; s <= e; s >>= 1, e >>= 1) {
      if (s & 1) r = min(r, d[s++]);
      if (~e & 1) r = min(r, d[e--]);
    }
    return r;
  }
} S, T;
int n, l, t, x[N];
int main() {
  scanf("%d%d%d", &n, &l, &t);
  for (int i = 1; i <= n; i++) scanf("%d", x + i);
  S.ini();
  T.ini();
  S.upd(0, 0);
  T.upd(0, -2 * x[1]);
  for (int i = 1, j = 0; i <= n; i++) {
    while (j < i - 1 && 2 * (x[i] - x[j + 1]) > t) j++;
    ll v = min(S.get(j, i - 1) + t + x[i], T.get(0, j - 1) + 3 * x[i]);
    S.upd(i, v - x[i]);
    T.upd(i, v - x[i] - 2 * x[i + 1]);
  }
  printf("%lld\n", S.get(n, n) + l);
}
