#include <bits/stdc++.h>
using namespace std;
int main(void) {
  srand(time(0));
  cout << fixed << setprecision(7);
  cerr << fixed << setprecision(7);
  int n, S, t;
  cin >> n >> S >> t;
  static int s[1 << 20];
  for (int i = 1; i <= n; ++i) cin >> s[i];
  static long long dp[1 << 20];
  dp[0] = 0;
  for (int i = 1; i <= n; ++i) {
    dp[i] = 1e18;
    for (int j = i - 1; j + 1; --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;
}
