#include <bits/stdc++.h>
void run(void) {
  int n, e, t;
  scanf("%d%d%d", &n, &e, &t);
  if (n > 2000) exit(1);
  int *x = (int *)calloc(n + 1, sizeof(int));
  int i;
  for (i = 1; i <= n; i++) scanf("%d", x + i);
  long long int *dp = (long long int *)calloc(n + 1, sizeof(long long int));
  for (i = 1; i <= n; i++) {
    long long int min = 1000000000LL * 3;
    int j;
    for (j = i; j > 0; j--) {
      long long int moveJ = dp[j - 1] + x[j] - x[j - 1];
      long long int d = x[i] - x[j];
      long long int v =
          moveJ + 2 * d + ((t - 2 * d) > (0) ? (t - 2 * d) : (0)) + d;
      min = ((min) < (v) ? (min) : (v));
    }
    dp[i] = min;
  }
  long long int ans = dp[n] + e - x[n];
  printf("%lld\n", ans);
}
int main(void) {
  run();
  return 0;
}
