#include <bits/stdc++.h>
using namespace ::std;
const long long maxn = 1e5 + 500;
const long long inf = 1e15 + 7;
long long dp[maxn];
long long a[maxn];
long long parminn[maxn];
int main() {
  fill(dp, dp + maxn, inf);
  long long n, e, t;
  cin >> n >> e >> t;
  t *= 2;
  e *= 2;
  long long ans = 0;
  for (long long i = 1; i <= n; i++) {
    cin >> a[i];
    a[i] *= 2;
  }
  long long p = 0;
  parminn[0] = 0;
  dp[0] = 0;
  for (long long i = 1; i <= n; i++) {
    while (p + 1 < i && a[i] - a[p] >= t / 2) {
      p++;
    }
    if (p == 0) {
      dp[i] = t;
    } else {
      dp[i] = min(dp[p] + t, parminn[p] + a[i] * 2);
    }
    parminn[i] = min(parminn[i - 1], dp[i - 1] - a[i] * 2);
  }
  cout << (dp[n] + e) / 2;
}
