#include <bits/stdc++.h>
using namespace std;
int x[1000005];
long long int dp[1000005], dp2[1000005];
int main() {
  int n, e, t;
  scanf("%d %d %d", &n, &e, &t);
  for (int i = 0; i < n; i++) dp[i] = 1e18;
  dp[0] = t;
  scanf("%d", &x[0]);
  for (int i = 1; i < n; i++) scanf("%d", &x[i]), x[i] -= x[0];
  x[0] = 0;
  int p = 0;
  dp[0] = t;
  dp2[0] = 1e9;
  for (int i = 1; i < n; i++) {
    dp[i] = max(t, x[i] * 2);
    while (t < (x[i] - x[p + 1]) * 2) p++;
    dp[i] = min(dp[i], t + dp[p]);
    dp2[i] = min(dp2[i - 1], dp[i - 1] - x[i] * 2);
    if (p > 0) dp[i] = min(dp[i], 2 * x[i] + dp2[p - 1]);
  }
  printf("%lld", dp[n - 1] + e);
}
