#include <bits/stdc++.h>
using namespace std;
const int MX = 200500;
long long dist[MX];
const long long inf = 1e18;
int x[MX];
int main() {
  ios_base::sync_with_stdio(false);
  int n, e, t;
  cin >> n >> x[n + 1] >> t;
  x[0] = 0;
  dist[0] = 0;
  for (int i = 1; i <= n; i++) {
    cin >> x[i];
    dist[i] = inf;
  }
  if (n > 2000) return 1;
  sort(x, x + n + 1);
  for (int i = 0; i < n; i++) {
    for (int j = i + 1; j <= n; j++) {
      long long d = x[j] - x[i + 1];
      d *= 2;
      if (d < t) d = t;
      d += x[j] - x[i];
      d += dist[i];
      if (dist[j] > d) dist[j] = d;
    }
  }
  cout << x[n + 1] - x[n] + dist[n] << "\n";
  return 0;
}
