#include <bits/stdc++.h>
using namespace std;
long long f[100010], c[100010], d[100010];
int x[100010];
int n, e, t, T;
int main() {
  scanf("%d%d%d", &n, &e, &t);
  T = t;
  if (t % 2) T++;
  for (int i = 1; i <= n; i++) scanf("%d", &x[i]);
  memset(f, 0x3f, sizeof(f));
  memset(c, 0x3f, sizeof(c));
  memset(d, 0x3f, sizeof(d));
  f[0] = 0;
  for (int i = 1; i <= n; i++) {
    f[i] = min(f[i], f[i - 1] + x[i] - x[i - 1] + t);
    for (int j = i + 1; j <= n; j++) {
      if ((x[j] - x[i]) * 2 >= t)
        f[j] = min(f[j], f[i - 1] + 3ll * (x[j] - x[i]) + x[i] - x[i - 1]);
      else
        f[j] = min(f[j], f[i - 1] + t - 2 * (x[j] - x[i]) +
                             3ll * (x[j] - x[i]) + x[i] - x[i - 1]);
    }
  }
  cout << f[n] + e - x[n];
}
