#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 = 1e5 + 5;
const long long INF = 0x3f3f3f3f3f3f3f3f;
int n, t, e, px[N];
long long f[N], p = 1, w = INF;
int main() {
  n = read(), e = read(), t = read();
  for (int i = 1; i <= n; ++i) px[i] = read();
  for (int i = 1; i <= n; ++i) {
    if (2 * (px[i] - px[p]) >= t)
      w = min(f[p - 1] - 2 * px[p] - px[p - 1], w), ++p;
    f[i] = min(f[i - 1] + px[i] - px[i - 1] + t, w + 3ll * px[i]);
  }
  printf("%lld\n", f[n] + e - px[n]);
  return 0;
}
