#include <bits/stdc++.h>
using namespace std;
static long long dp[1 << 20];
static long long pos[1 << 20];
static long long s[1 << 20];
long long n, S, T;
int32_t main(void) {
  srand(time(0));
  cout << fixed << setprecision(7);
  cerr << fixed << setprecision(7);
  cin >> n >> S >> T;
  for (long long i = 1; i <= n; ++i) cin >> s[i];
  for (long long i = 1; i <= n; ++i) {
    pos[i] = pos[i - 1];
    while (T < 2ll * (s[i] - s[pos[i]])) ++pos[i];
  }
  dp[0] = 0;
  for (long long i = 1; i <= n; ++i) {
    dp[i] = 1e18;
    for (long long j = max(0ll, pos[i] - 5); j <= min(i - 1, pos[i] + 5); ++j)
      dp[i] = min(dp[i], dp[j] + s[i] - s[j] + 2ll * (s[i] - s[j + 1]) +
                             max(0ll, 1ll * T - 2 * (s[i] - s[j + 1])));
  }
  cout << dp[n] + S - s[n] << '\n';
  cerr << "Time elapsed :" << clock() * 1000.0 / CLOCKS_PER_SEC << " ms"
       << '\n';
  return 0;
}
