#include <bits/stdc++.h>
using namespace std;
int p[100001], s[100001], l, r;
long long f[100001];
int main() {
  int n, e, t;
  scanf("%d%d%d", &n, &e, &t);
  for (int i = 1; i <= n; i++) scanf("%d", &p[i]);
  long long z = 2e9;
  for (int i = 1; i <= n; i++) {
    s[++r] = i;
    for (; 2 * (p[i] - p[s[l]]) >= t; l++)
      z = min(z, f[s[l] - 1] - 2 * p[s[l]]);
    f[i] = f[s[l] - 1] + t;
    f[i] = min(f[i], 2 * p[i] + z);
  }
  cout << f[n] + e;
}
