#include <bits/stdc++.h>
using namespace std;
long long n, e, t, f[(100000 + 1000)], a[(100000 + 1000)],
    Segt[(100000 + 1000) << 2], p;
void Update(long long now, long long l, long long r, long long x, long long v) {
  if (l == r) {
    Segt[now] = v;
    return;
  }
  long long mid = (l + r) >> 1;
  if (x <= mid)
    Update(now << 1, l, mid, x, v);
  else
    Update(now << 1 | 1, mid + 1, r, x, v);
  Segt[now] = min(Segt[now << 1], Segt[now << 1 | 1]);
}
long long Query(long long now, long long l, long long r, long long l1,
                long long r1) {
  if (l > r1 || r < l1) return 1e17;
  if (l1 <= l && r <= r1) return Segt[now];
  long long mid = (l + r) >> 1;
  return min(Query(now << 1, l, mid, l1, r1),
             Query(now << 1 | 1, mid + 1, r, l1, r1));
}
int main() {
  scanf("%lld%lld%lld", &n, &e, &t);
  for (int i = 1; i <= n; ++i) scanf("%lld", &a[i]);
  for (int i = 1; i <= n; ++i) {
    while (p <= i - 1 && 2 * (a[i] - a[p]) >= t)
      Update(1, 1, n, p, -2 * a[p]), p++;
    long long temp = 1e17;
    temp = min(temp, Query(1, 1, n, 1, p - 1));
    if (p <= i - 1) temp = min(temp, Query(1, 1, n, p, i - 1) + t - 2 * a[i]);
    f[i] = min(temp + 3 * a[i], f[i - 1] + a[i] - a[i - 1] + t);
    Update(1, 1, n, i, -a[i - 1] + f[i - 1]);
  }
  printf("%lld\n", f[n] + e - a[n]);
}
