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