#include <bits/stdc++.h>
using namespace std;
int x[1000005];
long long int dp[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 last = 0, lastt = 0;
  for (int i = 0; i < n; i++) {
    dp[i] = max(t, x[i] * 2);
    if (lastt != 0) dp[i] = min(dp[i], (x[i] - x[last + 1]) * 2 + dp[last]);
    for (int j = lastt; j < i; j++) {
      dp[i] = min(dp[i], max(t, (x[i] - x[j + 1]) * 2) + dp[j]);
      if ((x[i] - x[j + 1]) * 2 < t) {
        break;
        lastt = j;
      }
      if (dp[i] == (x[i] - x[j + 1]) * 2 + dp[j]) last = j;
    }
  }
  printf("%lld", dp[n - 1] + e);
}
