#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
const long long INF = (long long)1000000007 * 1000000007;
const long double eps = 1e-8;
const long double pi = acos(-1.0);
long long dp[1 << 17], x[1 << 17];
int main() {
  int n;
  cin >> n;
  long long e, t;
  cin >> t >> e;
  for (int i = 0; i < n; i++) {
    cin >> x[i];
  }
  x[n] = t;
  fill(dp, dp + n + 2, INF);
  dp[0] = x[0];
  for (int i = 0; i < n + 1; i++) {
    for (int j = i + 1; j < n + 2; j++) {
      dp[j] = min(dp[j], x[j] - x[i] + max(e, 2 * (x[j - 1] - x[i])) + dp[i]);
    }
  }
  cout << dp[n] << endl;
  return 0;
}
