#include <bits/stdc++.h>
using namespace std;
const int maxn = 100005;
const long long inf = (1LL << 60) - 1;
int n, e, t, p[maxn];
long long f[maxn];
struct ST {
  int l, r;
  long long val[2];
} st[maxn * 4];
void build(int id, int l, int r) {
  st[id].l = l, st[id].r = r, st[id].val[0] = st[id].val[1] = inf;
  if (l == r) return;
  int m = (l + r) >> 1;
  build(id << 1, l, m);
  build(id << 1 | 1, m + 1, r);
}
void update(int id, int pos, int sign, long long val) {
  if (st[id].l == st[id].r) {
    st[id].val[sign] = val;
    return;
  }
  int m = (st[id].l + st[id].r) >> 1;
  if (pos <= m)
    update(id << 1, pos, sign, val);
  else
    update(id << 1 | 1, pos, sign, val);
  st[id].val[sign] = min(st[id << 1].val[sign], st[id << 1 | 1].val[sign]);
}
long long query(int id, int l, int r, int sign) {
  if (st[id].l == l && st[id].r == r) {
    return st[id].val[sign];
  }
  int m = (st[id].l + st[id].r) >> 1;
  if (r <= m)
    return query(id << 1, l, r, sign);
  else if (l > m)
    return query(id << 1 | 1, l, r, sign);
  else {
    return min(query(id << 1, l, m, sign), query(id << 1 | 1, m + 1, r, sign));
  }
}
int main() {
  cin >> n >> e >> t;
  for (int i = 1; i <= n; i++) cin >> p[i];
  build(1, 1, n);
  for (int i = 1; i <= n; i++) {
    f[i] = max((p[i] - p[1]) * 2, t) + (long long)p[i];
    int l = 1, r = i - 1, ret = -1;
    while (l <= r) {
      int mid = (l + r) >> 1;
      if ((p[i] - p[mid + 1]) * 2 < t) {
        ret = mid;
        r = mid - 1;
      } else
        l = mid + 1;
    }
    long long tt = -1;
    if (ret != -1) {
      long long tmp = query(1, ret, i - 1, 1) + p[i];
      tt = tmp;
      if (ret > 1) {
        tmp = min(tmp, query(1, 1, ret - 1, 0) + 3 * p[i]);
        tt = tmp;
      }
    } else {
      if (1 <= i - 1) tt = query(1, 1, i - 1, 0) + 3 * p[i];
    }
    if (tt != -1) f[i] = min(f[i], tt);
    if (i < n) {
      update(1, i, 0, f[i] - 2 * p[i + 1] - p[i]);
      update(1, i, 1, f[i] + t - p[i]);
    }
  }
  cout << f[n] + e - p[n] << endl;
  return 0;
}
