#include <bits/stdc++.h>
using namespace std;
using lint = long long;
template <class T = int>
using V = vector<T>;
template <class T = int>
using VV = V<V<T> >;
int main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  assert(n <= 2000);
  lint E, T;
  cin >> E >> T;
  V<lint> x(n);
  for (auto&& e : x) cin >> e;
  V<lint> dp(n + 1, 9e18);
  dp[n] = 0;
  for (int i = n - 1; i >= 0; --i) {
    for (int j = i + 1; j <= n; ++j) {
      lint d = x[j - 1] - x[i];
      lint cost = 2 * d + max<lint>(T - 2 * d, 0) + (j < n ? x[j] : E) - x[i];
      dp[i] = min(dp[i], cost + dp[j]);
    }
  }
  cout << x[0] + dp[0] << '\n';
}
