#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e18;
int main() {
  int n;
  long long t, e;
  cin >> n >> e >> t;
  vector<long long> x(n);
  for (int i = 0; i < (int)(n); i++) {
    scanf("%lld", &x[i]);
  }
  vector<long long> dp(n + 1, INF);
  dp[0] = 0;
  vector<long long> minCF(n + 1, INF);
  long long minC = INF;
  for (int i = 0; i < (int)(n); i++) {
    long long pos = i == 0 ? 0 : x[i - 1];
    minC = min(minC, minCF[i + 1]);
    dp[i + 1] = min(dp[i + 1], x[i] * 3 + minC);
    int lf = i, rg = n - 1;
    while (rg - lf > 1) {
      int mid = (lf + rg) / 2;
      if ((x[mid] - x[i]) * 2 <= t) {
        lf = mid;
      } else {
        rg = mid - 1;
      }
    }
    int L = max(i, lf - 20);
    int R = min(n, rg + 20);
    minCF[R] = min(minCF[R], dp[i] + x[i] - pos - x[i] * 3);
    for (int j = L; j < R; j++) {
      long long delta = x[j] - x[i];
      long long add = x[i] - pos + delta + max(delta * 2, t);
      dp[j + 1] = min(dp[j + 1], dp[i] + add);
    }
  }
  cout << dp[n] + e - x[n - 1] << endl;
  return 0;
}
