#include <bits/stdc++.h>
using namespace std;
inline int read(int f = 1, int x = 0, char ch = ' ') {
  while (!isdigit(ch = getchar()))
    if (ch == '-') f = -1;
  while (isdigit(ch)) x = x * 10 + ch - '0', ch = getchar();
  return f * x;
}
const int N = 2e5 + 5;
const long long INF = 0x3f3f3f3f3f3f3f3f;
int n, t, e, px[N];
long long f[N];
int main() {
  n = read(), e = read(), t = read();
  if (n >= 2000) return 0;
  for (int i = 1; i <= n; ++i) px[i] = read();
  px[n + 1] = e;
  for (int i = 1; i <= n + 1; ++i) {
    f[i] = f[i - 1] + px[i] - px[i - 1] + t * (i <= n);
    for (int j = 1; j <= i; ++j)
      if (2 * (px[i] - px[j]) >= t)
        f[i] = min(f[i], f[j - 1] + px[j] - px[j - 1] + 3ll * (px[i] - px[j]));
  }
  printf("%lld\n", f[n + 1]);
  return 0;
}
