#include <bits/stdc++.h>
using namespace std;
void chmin(long long &x, long long y) {
  if (x > y) x = y;
}
long long dp[2020][2020];
int main() {
  int n;
  long long T, E;
  cin >> n >> E >> T;
  vector<long long> x(n);
  for (int i = 0; i < n; i++) scanf("%lld", &x[i]);
  vector<long long> d(n), ds(n + 1);
  for (int i = 0; i < n - 1; i++) d[i] = x[i + 1] - x[i];
  for (int i = 0; i < n; i++) ds[i + 1] = ds[i] + d[i];
  if (n > 2000) return 0;
  fill_n(*dp, 2020 * 2020, 1e17);
  dp[0][0] = 0;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j <= i; j++) {
      if (j == 0) {
        chmin(dp[i + 1][0], dp[i][j] + T + d[i]);
      }
      if (j > 0) {
        long long dist = ds[i] - ds[i - j];
        chmin(dp[i + 1][0],
              dp[i][j] + d[i] + max(0LL, T - 2 * dist) + dist * 2);
      }
      if (i < n - 1) {
        chmin(dp[i + 1][j + 1], dp[i][j] + d[i]);
      }
    }
  }
  long long ans = dp[n][0] + x[0] + (E - x[n - 1]);
  cout << ans << endl;
}
