#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline void output(T a, int p = 0) {
  if (p)
    cout << fixed << setprecision(p) << a << "\n";
  else
    cout << a << "\n";
}
int N, E, T;
vector<int> X;
vector<long long> dp;
long long f(int i, int j) {
  return dp[j] + (X[j + 1] - X[j]) + max(2 * (X[i] - X[j + 1]), T) + X[i] -
         X[j + 1];
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(0);
  cin >> N >> E >> T;
  X.assign(N + 1, 0);
  for (int i = (int)(1); i < (int)(N + 1); ++i) cin >> X[i];
  dp.assign(N + 1, 1LL << 60);
  dp[0] = 0;
  for (int i = (int)(1); i < (int)(N + 1); ++i) {
    int l = 0;
    int r = i - 1;
    while (l + 2 < r) {
      int ml = (2 * l + r) / 3;
      int mr = (l + 2 * r) / 3;
      if (f(i, ml) < f(i, mr)) {
        r = mr;
      } else {
        l = ml;
      }
    }
    for (int j = (int)(l); j < (int)(r + 1); ++j) {
      dp[i] = min(dp[i], f(i, j));
    }
  }
  long long ret = dp[N] + (E - X[N]);
  output(ret);
  return 0;
}
