#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 5;
long long n, e, t;
long long a[maxn], f[maxn];
long long q[maxn];
long long ans;
inline int read() {
  char ch = getchar();
  int x = 0, f = 1;
  while (ch > '9' || ch < '0') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
int main(int argc, char const *argv[]) {
  memset(f, 0x3f3f3f, sizeof f);
  n = read(), e = read(), t = read();
  long long ok = 0x3f3f3f;
  for (int i = 1; i <= n; ++i) a[i] = read();
  f[0] = 0;
  long long head = 1, tail = 1;
  for (int i = 1; i <= n; ++i) {
    while (head <= tail and 2 * (a[i] - a[q[head] + 1]) > t) {
      ok = min(ok, f[q[head] - 2 * a[q[head]] + 1]);
      head++;
    }
    f[i] = min(f[i], f[q[head]] + t);
    f[i] = min(f[i], ok + 2 * a[i]);
    q[++tail] = i;
  }
  ans = f[n] + e;
  std::cout << ans << '\n';
  return 0;
}
