#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch > '9' || ch < '0') ch == '-' && (f = 0) || (ch = getchar());
  while (ch <= '9' && ch >= '0')
    x = (x << 3) + (x << 1) + ch - '0', ch = getchar();
  return f ? x : -x;
}
long long f[100020][2], x[100020];
int main(int argc, char const *argv[]) {
  int n = read();
  long long E = read(), T = read();
  for (int i = 1; i <= n; ++i) {
    x[i] = read();
  }
  x[n + 1] = E;
  f[0][1] = 2 * x[1];
  for (int i = 1; i <= n; ++i) {
    long long llen = x[i] - x[i - 1];
    long long rlen = x[i + 1] - x[i];
    f[i][0] =
        min(f[i - 1][1] + max(2 * llen, T) - llen, f[i - 1][0] + llen + T);
    f[i][1] = min(f[i - 1][0] + llen + max(2 * rlen, T),
                  f[i - 1][1] + max(2 * llen + 2 * rlen, T) - llen);
  }
  printf("%lld\n", f[n][0] + x[n + 1] - x[n]);
  return 0;
}
