#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];
  for (int i = 1, k = 0; i <= n; i++) {
    dp[i] = 1ll << 40;
    while (k < n && (x[i] - x[k + 1]) * 2 > t) k++;
    dp[i] = min(dp[0] + x[i] + max(t, (x[i] - x[1]) << 1),
                dp[k] + x[i] - x[k] + max(t, (x[i] - x[k + 1]) << 1));
  }
  cout << dp[n] + e - x[n] << endl;
  return 0;
}
