#include <bits/stdc++.h>
using namespace std;
using int64 = long long;
int64 N, E, T;
vector<int64> pref;
vector<int64> dp;
vector<int64> x;
int main() {
  cin >> N >> E >> T;
  pref.resize(N + 1);
  x.resize(N + 1);
  for (int i = 0; i < N; i++) {
    cin >> x[i];
  }
  x[N] = E;
  for (int i = N - 1; i >= 0; i--) {
    pref[i] = pref[i + 1] + (x[i + 1] - x[i]);
  }
  dp.resize(N + 1);
  for (int i = N - 1; i >= 0; i--) {
    dp[i] = (1LL << 60);
    for (int j = i + 1; j <= N; j++) {
      int64 d = pref[i] - pref[j - 1];
      int64 l = pref[i] - pref[j];
      if (2 * d <= T) {
        dp[i] = min(dp[i], T + l + dp[j]);
      } else {
        dp[i] = min(dp[i], 2 * d + l + dp[j]);
      }
    }
  }
  cout << dp[0] + x[0] << "\n";
  return 0;
}
