#include <bits/stdc++.h>
long long MOD = 1e9 + 7;
using namespace std;
int in() {
  int x;
  scanf("%d", &x);
  return x;
}
long long lin() {
  long long x;
  scanf("%lld", &x);
  return x;
}
template <typename A, size_t NNN, typename T>
void Fill(A (&array)[NNN], const T &val) {
  fill((T *)array, (T *)(array + NNN), val);
}
int main() {
  long long n = lin(), e = lin(), t = lin();
  long long x[100001] = {};
  for (long long i = 1; i <= n; ++i) x[i] = lin();
  if (n > 2000) return 0;
  long long dp[2001] = {};
  for (long long i = 1; i <= n; ++i) {
    long long temp = 1e15;
    for (int j = 0; j < i; j++) {
      long long s = x[i] * 3 - x[j] - x[j + 1] * 2 +
                    max((long long)0, t - (x[i] - x[j + 1]) * 2);
      temp = min(temp, s + dp[j]);
    }
    dp[i] = temp;
  }
  cout << dp[n] + (e - x[n]);
}
