#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 20;
const long long inf = 1e15;
long long dp[maxn], partial_min[maxn], a[maxn];
int main() {
  fill(dp, dp + maxn, inf);
  long long n, e, T;
  cin >> n >> e >> T;
  e *= 2;
  T *= 2;
  for (int i = 1; i <= n; i++) cin >> a[i], a[i] *= 2;
  dp[0] = 0;
  int pt = 0;
  for (int i = 1; i <= n; i++) {
    while (pt + 1 < i && a[pt] <= a[i] - T / 2) pt++;
    if (!pt)
      dp[i] = T;
    else
      dp[i] = min(dp[pt] + T, partial_min[pt] + a[i] * 2);
    partial_min[i] = min(partial_min[i - 1], dp[i - 1] - a[i] * 2);
  }
  cout << (dp[n] + e) / 2 << endl;
}
