#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  const long long INFL = LLONG_MAX / 3;
  int N, E, T;
  cin >> N >> E >> T;
  vector<int> x(N + 1);
  vector<long long> f(N + 1, INFL), g(N + 1, INFL);
  f[0] = g[0] = 1;
  for (int i = 1; i <= N; ++i) cin >> x[i];
  int p = 0;
  multiset<long long> aa, bb;
  for (int i = 1; i <= N; ++i) {
    aa.insert(f[i - 1] + T);
    while (T < 2 * (x[i] - x[p + 1])) {
      bb.insert(f[p] - 2 * x[p + 1]);
      aa.erase(aa.find(f[p++] + T));
    }
    f[i] = *aa.begin();
    if ((int)(bb).size()) (f[i]) = min((f[i]), (2 * x[i] + (*bb.begin())));
  }
  cout << E + f[N] - x[1] << endl;
}
