#include <bits/stdc++.h>
using namespace std;
const long long N = 2e5 + 5;
long long n, E, T, x[N], f[N], Ans, k = 1e18;
long long l = 1, r = 1, q[N];
long long read() {
  long long x = 0, f = 1;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    x = (x << 1) + (x << 3) + c - '0';
    c = getchar();
  }
  return f * x;
}
int main() {
  memset(f, 0x3f, sizeof(f));
  n = read(), E = read(), T = read();
  for (register long long i = (1); i <= (n); i++) x[i] = read();
  f[0] = 0;
  for (register long long i = (1); i <= (n); i++) {
    while (l <= r && 2 * (x[i] - x[q[l] + 1]) > T) {
      k = min(k, f[q[l]] - 2 * x[q[l] + 1]);
      l++;
    }
    f[i] = min(f[i], f[q[l]] + T);
    f[i] = min(f[i], k + 2 * x[i]);
    while (l <= r && f[q[l]] - x[q[l]] >= f[i] - x[i]) r--;
    q[++r] = i;
  }
  Ans = f[n] + E;
  printf("%lld\n", Ans);
  return 0;
}
