#include <bits/stdc++.h>
#pragma warning(disable : 4996)
using namespace std;
int n;
long long E, T;
long long a[300000];
int S;
long long it[300000];
long long d[300000];
long long e[300000];
void update(int x) {
  for (x /= 2; x > 0; x /= 2) it[x] = min(it[x * 2], it[x * 2 + 1]);
}
long long getmin(int x, int y) {
  long long mi = 0x3f3f3f3f3f3f3f3fll;
  while (x <= y) {
    if (x % 2 == 1) mi = min(mi, it[x++]);
    if (y % 2 == 0) mi = min(mi, it[y--]);
    x /= 2, y /= 2;
  }
  return mi;
}
int main() {
  int i, j, k, l;
  cin >> n >> E >> T;
  for (i = 0; i < n; i++) scanf("%lld", &a[i]);
  for (S = 1; S < n; S *= 2)
    ;
  d[0] = a[0] + T;
  e[0] = 0 - 2 * a[0] - 0;
  for (i = 1; i < n; i++) {
    long long u = a[i] - T / 2;
    int x = lower_bound(a, a + n, u) - a;
    d[i] = 0x3f3f3f3f3f3f3f3fll;
    if (x > 0) d[i] = min(d[i], e[x - 1] + 3 * a[i]);
    d[i] = min(d[i], getmin(S + x, S + i - 1) + a[i] + T);
    d[i] = min(d[i], d[i - 1] + a[i] - a[i - 1] + T);
    e[i] = d[i - 1] - 2 * a[i] - a[i - 1];
    it[S + i] = d[i - 1] - a[i - 1];
    update(S + i);
  }
  cout << d[n - 1] + E - a[n - 1] << endl;
  return 0;
}
