#include <bits/stdc++.h>
using namespace std;
const double EPS = 1e-9;
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  long long n, e, t;
  cin >> n >> e >> t;
  vector<long long> a(n + 1, 0);
  for (long long i = (0); i < ((n)); i++) cin >> a[i + 1];
  vector<long long> dp(n + 1, (1LL << 60));
  dp[0] = 0;
  for (long long i = (0); i < ((n)); i++) {
    long long j = lower_bound(a.begin(), a.end(), a[i] + t) - a.begin();
    j = min(j, n);
    long long dist1 = a[j] - a[i], dist2 = a[j] - a[i + 1];
    dp[j] = min(dp[j], dp[i] + dist1 + dist2 * 2 + max(0LL, t - dist2 * 2));
  }
  cout << dp[n] + e - a.back() << endl;
  return 0;
}
