#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10;
int n, E, T, r;
int a[maxn];
long long Min1, Min2 = 1e18, f[maxn];
int main() {
  multiset<long long> S;
  scanf("%d%d%d", &n, &E, &T);
  for (int i = 1; i <= n; ++i) scanf("%d", &a[i]);
  S.insert(a[1]);
  for (int i = 1; i <= n; ++i) {
    while ((a[i] - a[r + 1]) * 2 >= T) {
      Min2 = min(Min2, f[r] - 2 * a[r + 1]);
      S.erase(S.find(f[r] + a[r + 1]));
      ++r;
    }
    f[i] = min(Min1 + 1ll * i * T, Min2 + 2 * a[i]);
    if (!S.empty()) f[i] = min(f[i], *S.begin() + T - a[i]);
    Min1 = min(Min1, f[i] - 1ll * i * T);
    S.insert(f[i] + a[i + 1]);
  }
  printf("%lld\n", f[n] + E);
  return 0;
}
