#include <bits/stdc++.h>
using namespace std;
class MQ {
 private:
  deque<long long> q;

 public:
  void push(long long val) {
    while (!(q.empty()) && q.back() > val) {
      q.pop_back();
    }
    q.push_back(val);
  }
  void pop(long long val) {
    if (!q.empty() && q.front() == val) {
      q.pop_front();
    }
  }
  long long front() { return q.front(); }
};
vector<long long> w, dp;
int main() {
  long long n, ti, ed;
  cin >> n >> ed >> ti;
  for (int i = 0; i < n; i++) {
    long long t;
    cin >> t;
    w.push_back(t);
  }
  w.push_back(ed);
  dp.assign(w.size(), 1e18);
  dp.back() = 0;
  long long rv = 1e18;
  MQ q;
  long long pt = dp.size() - 1;
  for (int i = n - 1; i >= 0; i--) {
    while (pt > i && (w[pt - 1] - w[i]) * 2 > ti) {
      q.pop(dp[pt]);
      rv = min(rv, dp[pt] + (w[pt - 1] - w[i]) * 2);
      pt--;
    }
    dp[i] = min(q.front() + ti, rv);
    q.push(dp[i]);
    if (i > 0) {
      rv += 2 * (w[i] - w[i - 1]);
    }
  }
  cout << dp[0] + ed << '\n';
}
