#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007ll;
const double EPS = 1e-11;
int n, e;
long long t;
int x[125252];
long long dp[125252];
constexpr long long INF = 1e18;
inline long long calc(int i, int j) {
  return dp[j + 1] + max(t, 2 * (long long)(x[j] - x[i]));
}
int main() {
  scanf("%d%d%lld", &n, &e, &t);
  for (int i = 0; i < (int)(n); ++i) scanf("%d", x + i);
  x[n] = e;
  assert(n <= 2000);
  for (int i = 0; i < (int)(n); ++i) dp[i] = -1;
  dp[n] = 0;
  long long ans = x[0];
  for (int i = 0; i < (int)(n); ++i) ans += x[i + 1] - x[i];
  for (int i = (int)(n)-1; i >= (int)(0); --i) {
    int l = i;
    int r = n - 1;
    while (l + 2 < r) {
      int midl = (2 * l + r) / 3;
      int midr = (l + 2 * r) / 3;
      if (calc(i, midl) < calc(i, midr)) {
        r = midr;
      } else {
        l = midl;
      }
    }
    dp[i] = INF;
    for (int j = (int)(l); j < (int)(r + 1); ++j) {
      dp[i] = min((dp[i]), (calc(i, j)));
    }
  }
  printf("%lld\n", ans + dp[0]);
  return 0;
}
