#include <bits/stdc++.h>
using namespace std;
template <class T>
bool cmin(T& a, T b) {
  return a > b ? a = b, true : false;
}
template <class T>
bool cmax(T& a, T b) {
  return a < b ? a = b, true : false;
}
template <class T>
T max(T& a, T& b) {
  return a > b ? a : b;
}
template <class T>
T min(T& a, T& b) {
  return a < b ? a : b;
}
const int maxn = 255000, inf = 1e9, mod = 9901;
int read() {
  int ch = getchar(), x = 0, f = 1;
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9')
    x = (x << 3) + (x << 1) + ch - '0', ch = getchar();
  return f * x;
}
long long n, e, t, a[maxn];
long long f[maxn], g[maxn];
int main() {
  n = read(), e = read(), t = read();
  for (int i = (1); i <= (n); i++) a[i] = read();
  memset(f, 10, sizeof(f));
  memset(g, 10, sizeof(g));
  f[1] = a[1];
  g[1] = a[1] + t;
  int w = 1;
  for (int i = (2); i <= (n); i++) {
    f[i] = g[i - 1] + a[i] - a[i - 1];
    while ((a[i] - a[w + 1]) * 2 >= t) w++;
    if (((a[i] - a[w]) << 1) >= t) cmin(g[i], f[w] + 3 * (a[i] - a[w]));
    cmin(g[i], f[i] + t);
  }
  printf("%lld\n", g[n] + e - a[n]);
  return 0;
}
