#include <bits/stdc++.h>
using namespace std;
const long long INF = (long long)1e18;
const int N = (int)1e5 + 100;
long long x[N];
long long ans[N];
long long upd[N];
int main(int, char **) {
  int n, e, t;
  scanf("%d%d%d", &n, &e, &t);
  for (int i = 0; i < n; i++) scanf("%lld", &x[i]);
  x[n] = e;
  upd[0] = INF;
  for (int i = 0; i <= n; i++) {
    upd[i + 1] = min(upd[i + 1], upd[i]);
    long long cur = 0;
    if (i > 0) {
      cur = upd[i - 1] + 2LL * x[i - 1];
      long long z = x[i - 1] - t / 2;
      int pos = lower_bound(x, x + n + 1, z) - x;
      long long ccur = t;
      ccur += ans[pos];
      42;
      cur = min(cur, ccur);
    }
    ans[i] = cur;
    int pos = lower_bound(x, x + n + 1, x[i] + (t + 1) / 2) - x;
    upd[pos] = min(upd[pos], ans[i] - 2 * x[i]);
    42;
    42;
  }
  printf("%lld\n", ans[n] + e);
  return 0;
}
