#include <bits/stdc++.h>
using namespace std;
int n, e, t;
int x[111111];
long long int dp2[111111];
long long int pref[111111];
int main() {
  scanf("%d%d%d", &n, &e, &t);
  x[0] = 0;
  for (int i = 1; i <= n; i++) scanf("%d", &x[i]);
  x[n + 1] = e;
  dp2[0] = 0;
  pref[0] = -2 * x[1];
  for (int i = 1; i <= n; i++) {
    int lo = 0, hi = i - 1;
    while (lo != hi) {
      int mi = (lo + hi) / 2;
      if ((x[i] - x[mi]) * 2 <= t)
        hi = mi;
      else
        lo = mi + 1;
    }
    dp2[i] = dp2[lo] + t;
    if (lo > 0) dp2[i] = min(dp2[i], pref[lo - 1] + 2 * x[i]);
    pref[i] = min(pref[i - 1], dp2[i] - 2 * x[i + 1]);
  }
  cout << dp2[n] + e << endl;
  return 0;
}
