#include <bits/stdc++.h>
using namespace std;
long long dp[2010];
long long n;
long long T, E;
long long x[2010];
signed main() {
  for (long long i = 0; i < 2010; i++) dp[i] = 1e18;
  cin >> n >> E >> T;
  assert(n <= 2000);
  for (long long i = 0; i < n; i++) {
    cin >> x[i];
  }
  dp[0] = x[0];
  for (long long i = 0; i < n; i++) {
    dp[i + 1] =
        min(dp[i + 1], dp[i] + T + (i + 1 < n ? x[i + 1] - x[i] : E - x[i]));
    for (long long j = i; j < n; j++) {
      dp[j + 1] = min(dp[j + 1],
                      dp[i] +
                          max(x[j] - x[i] + T,
                              max(x[i] + T, 2 * (x[j] - x[i])) + x[j] - x[i]) +
                          (j + 1 < n ? x[j + 1] - x[j] : E - x[j]));
    }
  }
  cout << dp[n] << endl;
}
