#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
const long long inf = 1e15;
long long dp[N];
int main() {
  cin.tie(0);
  cout.tie(0);
  ios_base::sync_with_stdio(0);
  long long n, e, t;
  cin >> n >> e >> t;
  vector<long long> pos(n + 1);
  for (int i = 0; i < n; ++i) cin >> pos[i];
  pos[n] = pos[n - 1];
  long long best = inf;
  int jp = n - 1;
  for (int i = n - 1; i >= 0; --i) {
    if (pos[n - 1] - pos[i] <= t / 2) {
      dp[i] = t + pos[n - 1] - pos[i];
    } else {
      if (i < n - 1) best += 3 * (pos[i + 1] - pos[i]);
      while (jp >= 0 && pos[jp] - pos[i] >= (t + 1) / 2) {
        best = min(best,
                   3 * (pos[jp] - pos[i]) + pos[jp + 1] - pos[jp] + dp[jp + 1]);
        --jp;
      }
      dp[i] = best;
      dp[i] = min(dp[i], t + pos[i + 1] - pos[i] + dp[i + 1]);
    }
  }
  cout << dp[0] + pos[0] + e - pos[n - 1] << '\n';
}
