#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  ios::sync_with_stdio(false);
  int N, E, T;
  cin >> N >> E >> T;
  auto bears = vector<ll>(N + 1);
  for (auto i = 1; i <= N; i++) cin >> bears[i];
  auto best = vector<ll>(N + 1);
  best[0] = 0;
  for (auto i = 1; i <= N; i++) {
    best[i] = numeric_limits<ll>::max();
    for (auto j = 0; j < i; j++) {
      auto option = best[j] + (bears[i] - bears[j]) + (bears[i] - bears[j + 1]);
      if (2 * (bears[i] - bears[j + 1]) < T)
        option += T - 2 * (bears[i] - bears[j + 1]);
      option += bears[i] - bears[j + 1];
      best[i] = min(best[i], option);
    }
  }
  cout << best[N] + (E - bears[N]) << endl;
}
