#include <bits/stdc++.h>
using namespace std;
int n, t, e;
long long f[100005], d[100005];
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;
}
long long cost(int l, int r) {
  return d[l] - d[l - 1] + (d[r] - d[l]) * 3 +
         ((d[r] - d[l]) * 2 <= t ? t - (d[r] - d[l]) * 2 : 0);
}
int main() {
  n = read();
  e = read();
  t = read();
  for (int i = 1; i <= n; ++i) d[i] = read();
  for (int i = 1; i <= n; ++i) {
    f[i] = 0x3f3f3f3f3f3f3f3f;
    for (int j = 0; j < i; ++j) f[i] = min(f[i], f[j] + cost(j + 1, i));
  }
  printf("%lld\n", f[n] + abs(e - d[n]));
}
