#include <bits/stdc++.h>
using namespace std;
inline int gi() {
  int x = 0, f = 1;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (isdigit(ch)) {
    x = (x << 3) + (x << 1) + ch - 48;
    ch = getchar();
  }
  return x * f;
}
template <typename T>
inline bool Max(T &a, T b) {
  return a < b ? a = b, 1 : 0;
}
template <typename T>
inline bool Min(T &a, T b) {
  return a > b ? a = b, 1 : 0;
}
const int N = 1e5 + 7;
int n, E, T;
long long f[N], x[N];
int q[N], hd = 1, tl;
int main() {
  n = gi(), E = gi(), T = gi();
  if (n > 2000) return puts("gg"), 0;
  memset(f, 0x3f, sizeof f);
  f[0] = 0;
  for (int i = 1; i <= n; ++i) x[i] = gi();
  long long mi = 1e18;
  q[++tl] = 0;
  for (int i = 1, j = 0; i <= n; ++i) {
    for (; j < i && 2 * (x[i] - x[j + 1]) >= T; ++j)
      Min(mi, f[j] - 2 * x[j + 1]);
    Min(f[i], mi + 2 * x[i]);
    while (hd <= tl && 2 * (x[i] - x[q[hd] + 1]) >= T) ++hd;
    if (hd <= tl) Min(f[i], f[q[hd]] + T);
    for (; hd <= tl && f[i] <= f[q[tl]]; --tl)
      ;
    q[++tl] = i;
  }
  printf("%lld\n", f[n] + E);
  return 0;
}
