#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] = 1e17;
    cin >> x[i];
  }
  x[0] = 0;
  int before = 1;
  long long now = 1e17;
  for (int i = 1; i <= N; i++) {
    now += 2 * (x[i] - x[i - 1]);
    while (2 * (x[i] - x[before]) >= T) {
      now = min(now, dp[before - 1] + (x[i] - x[before - 1]) +
                         2 * (x[i] - x[before]));
      before++;
    }
    dp[i] = min(dp[i], dp[before - 1] + (x[before] - x[before - 1]) + T + x[i] -
                           x[before]);
    dp[i] = min(dp[i], now);
  }
  cout << dp[N] + E - x[N] << endl;
  return 0;
}
