#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100005;
const long long INF = 1e18;
int n, a[MAXN], e, t;
struct node {
  long long x, y;
  node() { x = y = INF; }
  node(long long _x, long long _y) { x = _x, y = _y; }
  friend node operator+(const node &a, const node &b) {
    return (node){min(a.x, b.x), min(a.y, b.y)};
  }
};
node dat[MAXN * 4];
long long tag[MAXN * 4];
inline void update(int nd) { dat[nd] = dat[(nd << 1)] + dat[(nd << 1 | 1)]; }
inline void put_tag(int nd, int dt) {
  dat[nd].x += dt, dat[nd].y += dt, tag[nd] += dt;
}
inline void pdw(int nd) {
  put_tag((nd << 1), tag[nd]);
  put_tag((nd << 1 | 1), tag[nd]);
  tag[nd] = 0;
}
inline void modify(int nd, int L, int R, int opl, int opr, int dt) {
  pdw(nd);
  if (L == opl && R == opr)
    put_tag(nd, dt);
  else {
    int mid = (L + R) >> 1;
    if (opr <= mid)
      modify((nd << 1), L, mid, opl, opr, dt);
    else if (opl > mid)
      modify((nd << 1 | 1), mid + 1, R, opl, opr, dt);
    else
      modify((nd << 1), L, mid, opl, mid, dt),
          modify((nd << 1 | 1), mid + 1, R, mid + 1, opr, dt);
    update(nd);
  }
}
inline void modify(int nd, int L, int R, int pos, const node &pt) {
  pdw(nd);
  if (L == R)
    dat[nd] = pt;
  else {
    int mid = (L + R) >> 1;
    if (pos <= mid)
      modify((nd << 1), L, mid, pos, pt);
    else
      modify((nd << 1 | 1), mid + 1, R, pos, pt);
    update(nd);
  }
}
inline node query(int nd, int L, int R, int opl, int opr) {
  if (opl > opr) return (node){INF, INF};
  pdw(nd);
  if (L == opl && R == opr)
    return dat[nd];
  else {
    int mid = (L + R) >> 1;
    if (opr <= mid)
      return query((nd << 1), L, mid, opl, opr);
    else if (opl > mid)
      return query((nd << 1 | 1), mid + 1, R, opl, opr);
    else
      return query((nd << 1), L, mid, opl, mid) +
             query((nd << 1 | 1), mid + 1, R, mid + 1, opr);
  }
}
const int root = 1;
int main() {
  scanf("%d%d%d", &n, &e, &t);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  modify(root, 0, n, 0, (node){0, -2 * a[1]});
  int pos = -1;
  long long dpv;
  for (int i = 1; i <= n; i++) {
    while (pos + 1 < i && 2ll * (a[i] - a[pos + 2]) > t) pos++;
    dpv = min(query(root, 0, n, 0, pos).y + 3ll * a[i] - a[i - 1],
              query(root, 0, n, pos + 1, i - 1).x + a[i] - a[i - 1] + t);
    modify(root, 0, n, i, (node){dpv, dpv - 2 * a[i + 1]});
    modify(root, 0, n, 0, i - 1, a[i] - a[i - 1]);
  }
  cout << dpv + e - a[n] << endl;
  return 0;
}
