#include <bits/stdc++.h>
using namespace std;
long long dp[2005];
long long x[2005];
bool stack_better(int j1, int j2) {
  return dp[j1] - x[j1] + 2LL * x[j1 + 1] < dp[j2] - x[j2] + 2LL * x[j2 + 1];
}
bool deque_better(int i, int j) { return dp[i] - x[i] < dp[j] - x[j]; }
int main() {
  int n;
  long long t, e;
  cin >> n >> e >> t;
  for (int i = 1; i <= n; ++i) {
    cin >> x[i];
  }
  dp[0] = 0;
  deque<int> dq;
  stack<int> stk;
  dq.push_back(0);
  for (int i = 1; i <= n; ++i) {
    while (!dq.empty() && 2LL * (x[i] - x[dq.front() + 1]) >= t) {
      int j = dq.front();
      while (!stk.empty() && stack_better(j, stk.top())) {
        stk.pop();
      }
      dq.pop_front();
      stk.push(j);
    }
    dp[i] = 1LL << 60;
    if (!dq.empty()) {
      dp[i] = min(dp[i], dp[dq.front()] - x[dq.front()] + x[i] + t);
    }
    if (!stk.empty()) {
      dp[i] =
          min(dp[i], dp[stk.top()] - (x[stk.top()] + 2LL * x[stk.top() + 1]) +
                         3LL * x[i]);
    }
    while (!dq.empty() && deque_better(i, dq.back())) {
      dq.pop_back();
    }
    dq.push_back(i);
  }
  cout << dp[n] + (e - x[n]) << "\n";
  return 0;
}
