#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 7;
long long dp[N], x[N], premin[N];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, m, T;
  cin >> n >> m >> T;
  premin[0] = 1e18;
  for (int i = 1; i <= n; i++) {
    cin >> x[i];
    premin[i] = min(dp[i - 1] - 2 * x[i], premin[i - 1]);
    int idx = upper_bound(x + 1, x + i, x[i] - T / 2) - x - 1;
    dp[i] = min(premin[idx] + 2 * x[i], dp[idx] + T);
  }
  cout << dp[n] + m << endl;
}
