#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

const int N = 1e5 + 10;

int n, T, E;
ll x[N], dp[N];

int main() {
  scanf("%d %d %d", &n, &E, &T);
  for (int i = 1; i <= n; i++) scanf("%lld", &x[i]);
  x[n + 1] = E;
  ll mv = 1ll * n * T + E;
  for (int i = 1, j = 1; i <= n; i++) {
    dp[i] = dp[i - 1] + x[i] - x[i - 1] + T;
    for (; 2 * (x[i] - x[j]) >= T; j++)
      mv = min(mv, dp[j - 1] - x[j - 1] - 2 * x[j]);
      dp[i] = min(dp[i], mv + x[i] * 3);
    if (j < i) {
      dp[i] = min(dp[i], dp[j - 1] + x[i] - x[j - 1] + T);
    }
  }
  printf("%lld\n", dp[n] + E - x[n]);
  return 0;
}