#include <bits/stdc++.h>
const int N = 100000 + 10;
const long long INF = 1LL << 60;
int n, t, e, x[N];
long long f[N];
int main() {
  scanf("%d%d%d", &n, &e, &t);
  for (int i = 1; i <= n; ++i) scanf("%d", &x[i]);
  std::multiset<long long> a, b;
  for (int i = 1, j = 1; i <= n; ++i) {
    b.insert(f[i - 1]);
    for (; 2 * (x[i] - x[j]) > t; ++j) {
      b.erase(b.find(f[j - 1]));
      a.insert(f[j - 1] - 2 * x[j]);
    }
    f[i] = INF;
    if (!a.empty()) f[i] = 2 * x[i] + *a.begin();
    if (!b.empty()) f[i] = std::min(f[i], *b.rbegin() + t);
  }
  printf("%lld\n", f[n] + e);
  return 0;
}
