#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100005;
const long long INF = 0x3f3f3f3f3f3f3f3f;
long long t, e, n, d[MAXN];
long long c[MAXN], f[MAXN];
inline void update(int x, long long v) {
  for (; x <= n; x += (x & -x)) c[x] = min(c[x], v);
}
inline long long query(int x) {
  long long ret = INF;
  for (; x; x -= (x & -x)) ret = min(ret, c[x]);
  return min(ret, (long long)-2 * d[1]);
}
int main() {
  scanf("%lld%lld%lld", &n, &e, &t);
  for (int i = 1; i <= n; ++i) scanf("%lld", d + i);
  int p = 0;
  memset(f, 0x3f, sizeof(f));
  f[1] = t;
  for (int i = 2; i <= n; ++i) {
    while (p + 1 < i && 2 * (d[i] - d[p + 2]) >= t) ++p;
    if (2 * (d[i] - d[p + 1]) >= t) f[i] = min(f[i], query(p) + 2 * d[i]);
    if (2 * (d[i] - d[p + 1]) == t) f[i] = min(f[i], f[p] + t);
    f[i] = min(f[i], f[p + 1] + t);
    update(i, f[i] - 2 * d[i + 1]);
  }
  cout << f[n] + e << endl;
  return 0;
}
