#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
const long long INF = 1 << 30;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
const double pi = 3.141592653589793;
long long n, e, t;
long long x[2005];
long long dp[2005][2005];
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin >> n >> e >> t;
  if (n > 2000) return 0;
  for (int i = 0; i < (n); i++) cin >> x[i + 1];
  for (int i = 0; i < (n + 2); i++)
    for (int j = 0; j < (n + 2); j++) dp[i][j] = 1e15;
  dp[0][0] = 0;
  for (int i = 0; i < (n + 1); i++) {
    long long nx = x[i + 1] - x[i];
    for (int j = 0; j < (i + 1); j++) {
      dp[i + 1][j] = min(dp[i + 1][j], dp[i][j] + nx);
      if (i == j) continue;
      if (2 * (x[i] - x[j + 1]) >= t) {
        dp[i][i] = min(dp[i][i], dp[i][j] + 2 * (x[i] - x[j + 1]));
      } else {
        dp[i][i] = min(dp[i][i], dp[i][j] + t);
      }
    }
  }
  cout << dp[n][n] + e - x[n] << endl;
  return 0;
}
