#include <bits/stdc++.h>
using namespace std;
int x[1000005];
long long int dp[1000005];
long long int 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, mini = 1e9;
  dp[0] = t;
  dp2[0] = dp[0] - x[1] * 2;
  for (int i = 1; i < n; i++) {
    dp[i] = max(t, x[i] * 2);
    int Min = 0, Max = i - 1;
    while (Max - 1 > Min) {
      int mid = (Max + Min) / 2;
      if ((x[i] - x[mid + 1]) * 2 < t) {
        Min = mid;
      } else {
        Max = mid;
      }
    }
    if ((x[i] - x[p + 1]) * 2 > t) p++;
    dp[i] = min(x[i] * 2 + dp2[p - 1], t + dp[p]);
    dp2[i] = min(dp2[i - 1], dp[i] - x[i + 1] * 2);
  }
  printf("%lld", dp[n - 1] + e);
}
