#include <bits/stdc++.h>
using namespace std;
int N, E, T;
vector<int> X;
vector<int> Y;
map<int, long long> memo;
long long f(int p) {
  if (p == N) return 0;
  if (memo.count(p)) return memo[p];
  long long r = 1LL << 60;
  long long d = 0;
  for (int i = p; i < N; ++i) {
    long long e = max<long long>(T, d * 2);
    d += Y[i];
    auto x = f(i + 1) + d + e;
    r = min(r, x);
  }
  return memo[p] = r;
}
int main() {
  cin >> N >> E >> T;
  if (N > 2000) throw 1;
  X.resize(N);
  for (auto& x : X) cin >> x;
  for (int i = 1; i < N; ++i) {
    Y.push_back(X[i] - X[i - 1]);
  }
  Y.push_back(E - X[N - 1]);
  cout << f(0) + X[0] << endl;
}
