/**
 *    author:  tourist
 *    created: 13.01.2020 23:37:41       
**/
#include <bits/stdc++.h>

using namespace std;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  long long e, t;
  cin >> n >> e >> t;
  n += 1;
  vector<long long> x(n);
  for (int i = 1; i < n; i++) {
    cin >> x[i];
  }
  vector<long long> dp(n);
  multiset<long long> far;
  multiset<long long> near;
  int j = 0;
  near.insert(dp[0] + t - x[0]);
  for (int i = 1; i < n; i++) {
    while (j < i && 2 * (x[i] - x[j + 1]) >= t) {
      near.erase(near.find(dp[j] + t - x[j]));
      far.insert(dp[j] - x[j] - 2 * x[j + 1]);
      j += 1;
    }
    dp[i] = (long long) 1e18;
    if (!near.empty()) {
      dp[i] = min(dp[i], *near.begin() + x[i]);
    }
    if (!far.empty()) {
      dp[i] = min(dp[i], *far.begin() + 3 * x[i]);
    }
    near.insert(dp[i] + t - x[i]);
  }
  cout << dp[n - 1] + e - x[n - 1] << '\n';
  return 0;
}
