#include <bits/stdc++.h>
using namespace std;
int n, t, e;
long long f[100005], d[100005], v[100005];
deque<int> p, q;
int read() {
  char c = getchar();
  int x = 0;
  while (!isdigit(c)) c = getchar();
  while (isdigit(c)) {
    x = (x << 3) + (x << 1) + c - '0';
    c = getchar();
  }
  return x;
}
void pushp(int x) {
  while (!p.empty() && f[x] + v[x + 1] - d[x + 1] <
                           f[p.back()] + v[p.back() + 1] - d[p.back() + 1])
    p.pop_back();
  p.push_back(x);
}
void pushq(int x) {
  while (!q.empty() && f[x] + v[x + 1] - d[x + 1] * 3 <
                           f[q.back()] + v[q.back() + 1] - d[q.back() + 1] * 3)
    q.pop_back();
  q.push_back(x);
}
int main() {
  n = read();
  if (n > 2000) return 0;
  e = read();
  t = read();
  for (int i = 1; i <= n; ++i) {
    d[i] = read();
    v[i] = d[i] - d[i - 1];
  }
  p.push_back(0);
  for (int i = 1, j; i <= n; ++i) {
    while (!p.empty() && (d[i] - d[p.front() + 1]) * 2 > t) {
      pushq(p.front());
      p.pop_front();
    }
    f[i] = 0x3f3f3f3f3f3f3f3f;
    if (!p.empty()) {
      j = p.front();
      f[i] = min(f[i], f[j] + v[j + 1] - d[j + 1] + d[i] + t);
    }
    if (!q.empty()) {
      j = q.front();
      f[i] = min(f[i], f[j] + v[j + 1] - d[j + 1] * 3 + d[i] * 3);
    }
    pushp(i);
  }
  printf("%lld\n", f[n] + abs(e - d[n]));
}
