#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1.0);
double fRand(double fMin, double fMax) {
  double f = (double)rand() / RAND_MAX;
  return fMin + f * (fMax - fMin);
}
template <class T>
T min(T a, T b, T c) {
  return min(a, min(b, c));
}
template <class T>
T max(T a, T b, T c) {
  return max(a, max(b, c));
}
int n;
long long E, T, dp[100005], minF[100005], x[100005];
int main() {
  cin >> n >> E >> T;
  for (int i = (1); i <= (n); ++i) cin >> x[i];
  x[n + 1] = E;
  dp[0] = x[1];
  int j = 1;
  for (int i = (1); i <= (n); ++i) {
    while (2 * (x[i] - x[j]) >= T) ++j;
    dp[i] = dp[j - 1] + x[i + 1] + x[i] - 2 * x[j] + T;
    if (j > 1) dp[i] = min(dp[i], minF[j - 1] + x[i + 1] + 2 * x[i]);
    minF[i] = min(minF[i - 1], dp[i - 1] - 3 * x[i]);
  }
  printf("%lld", dp[n]);
  return 0;
}
