#include <bits/stdc++.h>
using namespace std;
int n, e, t, x[666666];
long long dp[666666], qzm[666666];
int main() {
  scanf("%d%d%d", &n, &e, &t);
  for (int i = 1; i <= n; i++) scanf("%d", x + i);
  if (n > 2000) exit(-1);
  memset(dp, 127 / 3, sizeof(dp));
  dp[0] = 0;
  memset(qzm, 127 / 3, sizeof(qzm));
  int p = 0;
  qzm[0] = dp[0] - 2 * x[1];
  for (int i = 1; i <= n; i++) {
    while ((x[i] - x[p + 1]) * 2 > t && p < i) ++p;
    if (p < i) dp[i] = dp[p] + t;
    if (p) dp[i] = min(dp[i], qzm[p - 1] + 2 * x[i]);
    qzm[i] = min(qzm[i - 1], dp[i] - 2 * x[i + 1]);
  }
  cout << dp[n] + e << "\n";
}
