#include <bits/stdc++.h>
using namespace std;
long long n, en, ti, pos[100000], dp[100000];
multiset<long long> ms, tris;
int main() {
  cin >> n >> en >> ti;
  for (long long i = 0; i < n; i++) {
    cin >> pos[i];
  }
  sort(pos, pos + n);
  for (long long i = 0; i < n; i++) dp[i] = 1234567890987654321;
  long long nexty = 0;
  for (long long i = 0; i < n; i++) {
    while (nexty < n && i > 0 && 2 * (pos[i] - pos[nexty]) >= ti) {
      if (nexty == 0)
        ms.insert(-(2 * pos[nexty]));
      else
        ms.insert(dp[nexty - 1] - (2 * pos[nexty]));
      ++nexty;
    }
    if (i == 0)
      dp[i] = ti;
    else {
      if (ms.empty()) {
        dp[i] = min(
            (max(0LL, ti - (2 * (pos[i] - pos[0]))) + (2 * (pos[i] - pos[0]))),
            ti + dp[i - 1]);
      } else {
        dp[i] = min(ti + dp[i - 1], *ms.begin() + (2 * pos[i]));
      }
    }
    if (i > 0)
      tris.insert(dp[i - 1]);
    else
      tris.insert(0);
  }
  if (0)
    for (long long i = 0; i < n; i++) cout << dp[i] << "\n";
  cout << dp[n - 1] + en << "\n";
}
