#include <bits/stdc++.h>
using namespace std;
int n, e, t, x[200000];
long long dp[200000];
int main() {
  cin >> n >> e >> t;
  for (int i = 1; i <= n; i++) cin >> x[i];
  set<pair<long long, int>> s;
  for (long long i = 1, j = 0, buf = 1ll << 40; i <= n; i++) {
    while (t < (x[i] - x[j + 1]) * 2) {
      buf = min(buf, dp[j] - x[j] - x[j + 1] * 2);
      s.erase({dp[j] - x[j], j});
      j++;
    }
    dp[i] = min(buf + x[i] * 3ll, s.begin()->first + x[i] + t);
    s.insert({dp[i] - x[i], i});
  }
  cout << dp[n] + e - x[n] << endl;
  return 0;
}
