#include <bits/stdc++.h>
const int MAXN = 100010;
const long long INF = 0x3f3f3f3f3f3f3f3fLL;
int at[MAXN], T, n, E, q[MAXN], b, e;
long long f[MAXN];
int main() {
  std::ios_base::sync_with_stdio(false), std::cin.tie(0);
  std::cin >> n >> E >> T;
  int cur = 0;
  long long pre = INF;
  for (int i = 1; i <= n; ++i) {
    std::cin >> at[i];
    while (2 * (at[i] - at[cur + 1]) >= T) {
      pre = std::min(pre, f[cur] - 2 * at[cur + 1]);
      ++cur;
    }
    while (b <= e && at[q[b]] < cur) ++b;
    f[i] = std::min(pre + 2 * at[i], b <= e ? f[q[b]] + T : INF);
    while (b <= e && f[i] <= f[q[e]]) --e;
    q[++e] = i;
  }
  std::cout << f[n] + E << std::endl;
  return 0;
}
