#include <bits/stdc++.h>
using namespace std;
int n, t, e;
int x[100005];
vector<int> vec[100005], ng;
long long dp[100005];
int main() {
  cin >> n >> e >> t;
  for (int i = 1; i <= n; i++) cin >> x[i];
  for (int i = 1; i < n; i++) {
    int y = x[i + 1] - x[i];
    if (y > t / 2) {
      ng.push_back(i);
    }
  }
  ng.push_back(n);
  for (int i = 1; i <= n; i++) {
    int c = x[i] + t / 2;
    int f = upper_bound(x + 1, x + n + 1, c) - x;
    vec[i].push_back(f - 1);
    vec[i].push_back(i);
    f = lower_bound(ng.begin(), ng.end(), c) - ng.begin();
    if (f == ng.size())
      vec[i].push_back(n);
    else
      vec[i].push_back(ng[f]);
  }
  for (int i = 1; i <= n; i++) {
    dp[i] = 1e18;
  }
  dp[0] = 0;
  for (int i = 0; i < n; i++) {
    if (dp[i] > 1e17) continue;
    int c = x[i + 1] + t / 2;
    int f = upper_bound(x + 1, x + n + 1, c) - x;
    int beg = f - 1;
    for (int j = beg; j <= min(n, beg + 3000); j++) {
      long long dif = x[j] - x[i + 1];
      long long ans = dp[i];
      ans += x[i + 1] - x[i];
      ans += dif + max(dif * 2LL, 1LL * t);
      dp[j] = min(dp[j], ans);
    }
  }
  cout << dp[n] + e - x[n] << endl;
}
