#include <bits/stdc++.h>
using namespace std;
int F() {
  char ch;
  int x, a;
  while (ch = getchar(), (ch < '0' || ch > '9') && ch != '-')
    ;
  if (ch == '-')
    ch = getchar(), a = -1;
  else
    a = 1;
  x = ch - '0';
  while (ch = getchar(), ch >= '0' && ch <= '9')
    x = (x << 1) + (x << 3) + ch - '0';
  return a * x;
}
const int MaxN = 1e5 + 10;
int N, E, T, x[MaxN];
long long f[MaxN];
int find(int i) {
  int j = i;
  for (int k = 18; ~k; --k)
    if ((j - (1 << k)) >= 0 && 2 * (x[i] - x[j - (1 << k) + 1]) <= T)
      j -= 1 << k;
  return j;
}
int main() {
  ((((N) = F()), ((E) = F())), ((T) = F()));
  for (int i = 1; i <= N; ++i) ((x[i]) = F()), f[i] = 1e18;
  for (int i = 1; i <= N; ++i) {
    int k = find(i);
    for (int j = 0; j < k; ++j)
      f[i] = min(f[i], f[j] + x[i] - x[j] + 2 * (x[i] - x[j + 1]));
    for (int j = k; j < i; ++j) f[i] = min(f[i], f[j] + x[i] - x[j] + T);
  }
  f[N] += E - x[N];
  printf("%lld\n", f[N]);
  return 0;
}
