#include <bits/stdc++.h>
using namespace std;
const long long inf = 1e18;
long long x[111111], dp[111111], pmn[111111];
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n, t, e;
  cin >> n >> e >> t;
  for (long long i = 1; i <= n; i++) cin >> x[i];
  pmn[0] = -2 * x[1];
  for (long long i = 1; i <= n; i++) {
    long long j = lower_bound(x + 1, x + n + 1, x[i] - t / 2.0) - x;
    if ((x[i] - x[j]) * 2 < t) j--;
    dp[i] = min(dp[j] + t, pmn[j - 1] + 2 * x[i]);
    pmn[i] = min(pmn[i - 1], dp[i] - 2 * x[i + 1]);
  }
  cout << dp[n] + e << endl;
  return 0;
}
