#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100000;
int x[MAXN + 1];
long long dp[MAXN + 1];
int main() {
  int n, e, t;
  cin >> n >> e >> t;
  for (int i = 1; i <= n; i++) cin >> x[i];
  for (int i = 0; i <= MAXN; i++) dp[i] = 1e18;
  dp[0] = 0;
  for (int i = 1; i <= n; i++) {
    dp[i] = min(dp[i], dp[i - 1] + (x[i] - x[i - 1]) + t);
    for (int j = 0; j <= 0; j++) {
      long long need = 2 * (x[i] - x[j]);
      need += max(0LL, t - need);
      dp[i] = min(dp[i], dp[j - 1] + need + (x[i] - x[j]) +
                             (j > 0 ? (x[j] - x[j - 1]) : 0));
    }
    int l = 0, r = i, m;
    while (r > l + 1) {
      m = (l + r) / 2;
      long long need = 2 * (x[i] - x[m]);
      if (need < t)
        r = m;
      else
        l = m;
    }
    for (int j = max(1, r - 10); j < min(i, r + 10); j++) {
      long long need = 2 * (x[i] - x[j]);
      need += max(0LL, t - need);
      dp[i] = min(dp[i], dp[j - 1] + need + (x[i] - x[j]) +
                             (j > 0 ? (x[j] - x[j - 1]) : 0));
    }
  }
  dp[n] += e - x[n];
  cout << dp[n] << endl;
  return 0;
}
