#include <bits/stdc++.h>
using namespace std;
using ulong = unsigned long;
using ll = long long;
const int M = 1e9 + 7;
#pragma unused(M)
int n, e, t;
vector<ll> xs;
ll memo[100010][2];
ll solve(int pos, bool round) {
  if (memo[pos][round]) {
    return memo[pos][round];
  }
  ll time = round ? 2 * (xs[pos + 1] - xs[pos]) : 0;
  if (pos == 0) {
    return xs[0] + max(0ll, t - time);
  }
  ll dx = xs[pos] - xs[pos - 1];
  return memo[pos][round] =
             min(solve(pos - 1, false) + dx + max(0ll, (t - time)),
                 solve(pos - 1, true) + 3 * dx);
}
int main() {
  cin >> n >> e >> t;
  vector<ll> xs(n);
  for (int i = 0; i < n; i++) {
    cin >> xs[i];
  }
  ::xs = xs;
  cout << solve(n - 1, false) + e - xs.back() << endl;
  return 0;
}
