#include <bits/stdc++.h>
using namespace std;
int x[100001];
long long dp[100001];
int main() {
  int n, e, t, i, j;
  scanf("%d %d %d", &n, &e, &t);
  for (i = 0; i < n; i++) scanf("%d", &x[i]);
  if (n > 2000) return 0;
  x[n] = e;
  for (i = 0; i <= n; i++) dp[i] = 1e18;
  dp[0] = x[0];
  for (i = 0; i < n; i++) {
    for (j = i + 1; j <= n; j++) {
      int c = max(t - (x[j - 1] - x[i]) * 2, 0);
      dp[j] = min(dp[j], dp[i] + (long long)(x[j - 1] - x[i]) * 3 + x[j] -
                             x[j - 1] + c);
    }
  }
  printf("%lld\n", dp[n]);
  return 0;
}
