#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2010;
long long getdist(vector<long long>& x, long long T, int i, int j,
                  bool& param) {
  long long ret = 0;
  ret = x[j] - x[i];
  ret += max(T, (x[j] - x[i + 1]) * 2);
  if (T < (x[j] - x[i]) * 2)
    param = true;
  else
    param = false;
  return ret;
}
int main() {
  long long N, E, T;
  cin >> N >> E >> T;
  vector<long long> x;
  x.push_back(0);
  for (int i = 0; i < N; i++) {
    long long y;
    cin >> y;
    x.push_back(y);
  }
  long long INF = 1000000;
  INF *= INF * INF;
  long long ret = INF;
  vector<long long> ans(N + 1, INF);
  ans[0] = 0;
  long long pos = 0;
  long long p2 = 0;
  for (int i = 1; i <= N; i++) {
    long long prev = INF;
    pos = p2;
    pos--;
    pos = max((long long)0, pos);
    while (true) {
      if (pos == i) break;
      bool a;
      long long data = getdist(x, T, pos, i, a);
      if (ans[i] > ans[pos] + data) p2 = pos;
      ans[i] = min(ans[i], ans[pos] + data);
      prev = data;
      if (!a) break;
      pos++;
    }
  }
  bool tmp;
  for (int i = 0; i < N; i++) {
    int j = N;
    ans[j] = min(ans[j], ans[i] + getdist(x, T, i, j, tmp));
  }
  cout << ans[N] + (E - x[N]) << endl;
  return 0;
}
