#include <bits/stdc++.h>
using namespace std;
const int RLEN = 1 << 18 | 1;
inline char nc() {
  static char ibuf[RLEN], *ib, *ob;
  (ib == ob) && (ob = (ib = ibuf) + fread(ibuf, 1, RLEN, stdin));
  return (ib == ob) ? -1 : *ib++;
}
inline int rd() {
  char ch = nc();
  int i = 0, f = 1;
  while (!isdigit(ch)) {
    if (ch == '-') f = -1;
    ch = nc();
  }
  while (isdigit(ch)) {
    i = (i << 1) + (i << 3) + ch - '0';
    ch = nc();
  }
  return i * f;
}
const int N = 1e5 + 50;
int n, E, T;
int xc[N];
long long f[N];
int main() {
  n = rd(), E = rd(), T = rd();
  for (int i = 1; i <= n; i++) xc[i] = rd();
  xc[n + 1] = E;
  memset(f, 0x3f, sizeof(f));
  f[0] = 0;
  f[1] = xc[1];
  for (int i = 2, j = 1; i <= n; i++) {
    while (2 * (xc[i] - xc[j]) >= T) ++j;
    j--;
    f[i] = min(f[i], f[i - 1] + T + xc[i] - xc[i - 1]);
    f[i + 1] = f[j] + 2 * (xc[i] - xc[j]) + xc[i + 1] - xc[j];
    ++j;
  }
  cout << min(f[n + 1], f[n] + T + xc[n + 1] - xc[n]);
}
