#include <bits/stdc++.h>
using namespace std;
const int MXN = 2001;
int N, T, E;
long long xs[MXN];
long long m[MXN][MXN] = {};
long long solve(int i, int lastp) {
  if (m[i][lastp] != -1) return m[i][lastp];
  long long tmp;
  if (i == N) {
    if (lastp == 0)
      tmp = T;
    else
      tmp = max(T - 2 * (xs[i] - xs[lastp]), 0LL) + 2 * (xs[i] - xs[lastp]);
    return m[i][lastp] = tmp;
  }
  if (lastp == 0)
    tmp = T + (xs[i + 1] - xs[i]) + solve(i + 1, 0);
  else
    tmp = max(T - 2 * (xs[i] - xs[lastp]), 0LL) + 2 * (xs[i] - xs[lastp]) +
          solve(i + 1, 0) + (xs[i + 1] - xs[i]);
  tmp = min(tmp, solve(i + 1, lastp == 0 ? i : lastp) + (xs[i + 1] - xs[i]));
  return m[i][lastp] = tmp;
}
int main() {
  memset(m, -1, sizeof m);
  cin >> N >> E >> T;
  for (int x = 0; x < N; x++) cin >> xs[x + 1];
  cout << solve(1, 0) + xs[1] + (E - xs[N]) << "\n";
}
