#include <bits/stdc++.h>
using namespace std;
long long N, E, T;
long long x[100050];
long long dp[100050];
int main() {
  cin >> N >> E >> T;
  for (int i = 1; i <= N; i++) {
    dp[i] = 1e16;
    cin >> x[i];
  }
  x[0] = 0;
  int before = 0;
  long long now = 1e16;
  for (int i = 1; i <= N; i++) {
    now += 2 * (x[i] - x[i - 1]);
    while (2 * (x[i] - x[before + 1]) > T) {
      now = min(now,
                dp[before] + (x[i] - x[before]) + 2 * (x[i] - x[before + 1]));
      before++;
    }
    dp[i] = dp[i - 1] + x[i] - x[i - 1] + T;
    if (before < i - 1)
      dp[i] = min(dp[i], dp[before] + 2 * T + x[i] - x[before]);
    dp[i] = min(dp[i], now);
  }
  cout << dp[N] + E - x[N] << endl;
  return 0;
}
