#include <bits/stdc++.h>
using namespace std;
const long long int MOD = 1000000007;
const long long BIG = 1446803456761533460;
const int Big = 336860180;
stringstream sss;
const long long int maxn = 100010;
long long int N, T, E;
long long int X[maxn];
long long int dp[maxn], pmn[maxn];
void MAIN() {
  cin >> N >> E >> T;
  for (long long int i = (0); i < (N); ++i) cin >> X[i + 1];
  dp[N] = E - X[N];
  pmn[N] = dp[N] + X[N] * 3;
  pmn[N + 1] = BIG;
  long long int ptr = N;
  for (long long int i = (N)-1; i >= (0); --i) {
    while ((X[ptr] - X[i + 1]) * 2 > T) --ptr;
    dp[i] = T + dp[ptr];
    dp[i] = min(dp[i], (pmn[ptr + 1] - X[i + 1] * 3));
    dp[i] += X[i + 1] - X[i];
    pmn[i] = min(pmn[i + 1], dp[i] + X[i] * 3);
  }
  cout << dp[0] << '\n';
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  cout << fixed << setprecision(10);
  sss << R"(
3 9 3
1 3 8
    )";
  MAIN();
  return 0;
}
