#include <bits/stdc++.h>
using namespace std;
struct pairhash {
 public:
  template <typename T, typename U>
  size_t operator()(const pair<T, U> &x) const {
    size_t seed = hash<T>()(x.first);
    return hash<U>()(x.second) + 0x9e3779b9 + (seed << 6) + (seed >> 2);
  }
};
const int inf = 1e9 + 9;
const long long mod = 1e9 + 7;
const double eps = 1e-8;
const double pi = acos(-1);
int n;
long long e, t;
long long x[100010];
long long memo[100010];
long long calc(int k) {
  if (memo[k] < 0) {
    if (k == n)
      memo[k] = 0;
    else {
      long long res = t + x[k + 1] - x[k] + calc(k + 1);
      int x0 = k + 1, x3 = n - 1, x1, x2;
      long long v1, v2;
      long long d;
      while (x3 - x0 > 2) {
        x1 = x0 + (x3 - x0) / 3;
        x2 = x0 + 2 * (x3 - x0) / 3;
        d = x[x1] - x[x1];
        v1 = 3 * d + max(0LL, t - 2 * d) + calc(x1 + 1) + x[x1 + 1] - x[x1];
        d = x[x2] - x[x2];
        v2 = 3 * d + max(0LL, t - 2 * d) + calc(x2 + 1) + x[x2 + 1] - x[x2];
        if (v1 < v2) {
          x3 = x2;
        } else {
          x0 = x1;
        }
      }
      for (int i = k + 1; i < n; i++) {
        long long d = x[i] - x[k];
        res = min(res,
                  3 * d + max(0LL, t - 2 * d) + calc(i + 1) + x[i + 1] - x[i]);
      }
      d = x[x0] - x[x0];
      res = min(res,
                3 * d + max(0LL, t - 2 * d) + calc(x0 + 1) + x[x0 + 1] - x[x0]);
      d = x[x1] - x[x1];
      res = min(res,
                3 * d + max(0LL, t - 2 * d) + calc(x1 + 1) + x[x1 + 1] - x[x1]);
      d = x[x2] - x[x2];
      res = min(res,
                3 * d + max(0LL, t - 2 * d) + calc(x2 + 1) + x[x2 + 1] - x[x2]);
      d = x[x3] - x[x3];
      res = min(res,
                3 * d + max(0LL, t - 2 * d) + calc(x3 + 1) + x[x3 + 1] - x[x3]);
      memo[k] = res;
    }
  }
  return memo[k];
}
long long solve() {
  memset(memo, -1, sizeof(memo));
  x[n] = e;
  return calc(0) + x[0];
}
void input() {
  cin >> n >> e >> t;
  for (int i = 0; i < n; i++) cin >> x[i];
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout << fixed << setprecision(15);
  input();
  cout << solve() << '\n';
}
