#include <bits/stdc++.h>
using namespace std;
long long f[100008], g[100008];
int x[100008];
int main() {
  register int n, e, t, i, j;
  register long long fmin = 3000000000ll;
  scanf("%d %d %d", &n, &e, &t);
  for (i = 1; i <= n; ++i) scanf("%d", &x[i]);
  f[0] = 0;
  g[0] = -2 * x[1];
  for (j = 0, i = 1; i <= n; ++i) {
    while (2 * (x[i] - x[j + 1]) > t) {
      (fmin > (f[j] - x[j + 1] * 2) ? fmin = (f[j] - x[j + 1] * 2) : 0);
      ++j;
    }
    f[i] = ((fmin + 2 * x[i]) < (g[i - 1] + t) ? (fmin + 2 * x[i])
                                               : (g[i - 1] + t));
    g[i] = ((f[i] - 2 * x[i + 1]) < (g[i - 1]) ? (f[i] - 2 * x[i + 1])
                                               : (g[i - 1]));
  }
  printf("%lld\n", f[n] + e);
  return 0;
}
