#include <bits/stdc++.h>
using namespace std;
int N;
long long T, E;
long long dp[100010] = {};
const long long inf = 1e18;
int main() {
  cin >> N >> E >> T;
  assert(N <= 2000);
  vector<long long> X(N + 1, 0);
  for (int i = 1; i <= N; i++) {
    cin >> X[i];
    dp[i] = inf;
  }
  for (int i = 1; i <= N; i++) {
    dp[i] = dp[i - 1] + X[i] - X[i - 1] + T;
    int id = upper_bound(X.begin(), X.end(), X[i] - T) - X.begin();
    if (id < i - 1)
      dp[i] = min(dp[i], dp[id] + X[id + 1] - X[id] + 3 * (X[i] - X[id + 1]) +
                             max(T - 2 * (X[i] - X[id + 1]), 0LL));
    if (id > 0)
      dp[i] = min(dp[i], dp[id - 1] + X[id] - X[id - 1] + 3 * (X[i] - X[id]) +
                             max(T - 2 * (X[i] - X[id]), 0LL));
    if (id > 1)
      dp[i] = min(dp[i], dp[id - 2] + X[id - 1] - X[id - 2] +
                             3 * (X[i] - X[id - 1]) +
                             max(T - 2 * (X[i] - X[id - 1]), 0LL));
  }
  cout << dp[N] + (E - X[N]) << endl;
}
