#include <bits/stdc++.h>
using namespace std;
long long x[200010];
long long dp[200010];
int main() {
  int n;
  long long e, t;
  cin >> n >> e >> t;
  for (int i = 1; i <= n; ++i) {
    cin >> x[i];
  }
  x[n + 1] = e;
  dp[1] = x[1];
  for (int i = 2; i <= n + 1; ++i) {
    dp[i] = 1LL << 60;
  }
  for (int i = 1; i <= n; ++i) {
    if (dp[i] == 1LL << 60) continue;
    int lo = i, hi = n + 1;
    while (hi - lo > 1) {
      int mid = (lo + hi) / 2;
      if (2 * (x[mid] - x[i]) <= t) {
        lo = mid;
      } else {
        hi = mid;
      }
    }
    dp[lo + 1] =
        min(dp[lo + 1], dp[i] + 3 * (x[lo] - x[i]) + (t - 2 * (x[lo] - x[i])) +
                            x[lo + 1] - x[lo]);
    if (lo + 2 <= n + 1) {
      dp[lo + 2] = min(dp[lo + 2],
                       dp[i] + 3 * (x[lo + 1] - x[i]) + x[lo + 2] - x[lo + 1]);
    }
  }
  cout << dp[n + 1];
}
