#include <bits/stdc++.h>
using namespace std;
long long big = 1000000007ll;
long long n, m, k;
long long T;
long long e;
vector<long long> X;
vector<long long> F;
long long DP[100001] = {0};
long long dp(long long i) {
  if (i == n) return 0;
  if (DP[i] != -1) return DP[i];
  long long l = i;
  long long r = n - 1;
  while (l < r - 1) {
    long long mid = (l + r) / 2 - 1;
    long long t1 = 3 * (X[mid] - X[i]) + max(0ll, T - 2 * (X[mid] - X[i])) +
                   F[mid] + dp(mid + 1);
    long long t2 = 3 * (X[mid + 1] - X[i]) +
                   max(0ll, T - 2 * (X[mid + 1] - X[i])) + F[mid + 1] +
                   dp(mid + 2);
    if (t2 < t1) {
      l = mid + 1;
    } else {
      r = mid;
    }
  }
  long long t1 =
      3 * (X[l] - X[i]) + max(0ll, T - 2 * (X[l] - X[i])) + F[l] + dp(l + 1);
  long long t2 =
      3 * (X[r] - X[i]) + max(0ll, T - 2 * (X[r] - X[i])) + F[r] + dp(r + 1);
  ;
  long long ans = min(t1, t2);
  DP[i] = ans;
  return ans;
}
int main() {
  long long a, b, c, d, e;
  long long c1, c2, c3, c4;
  cin >> n >> e >> T;
  for (c1 = 0; c1 < n; c1++) {
    cin >> a;
    X.push_back(a);
    DP[c1] = -1;
  }
  for (c1 = 0; c1 < n - 1; c1++) {
    F.push_back(X[c1 + 1] - X[c1]);
  }
  F.push_back(e - X[n - 1]);
  cout << dp(0) + X[0] << "\n";
  return 0;
}
