#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100007;
const int INF = 1000000007;
const long long LINF = INF * (long long)INF;
long long A[MAXN], DP[MAXN];
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int n, e, t;
  cin >> n >> e >> t;
  for (int i = (1); i < (n + 1); ++i) cin >> A[i];
  DP[0] = A[0] = 0;
  DP[1] = A[1] + t;
  for (int i = (2); i < (n + 1); ++i) {
    int j = lower_bound(A, A + i, A[i] - (t + 1) / 2) - A;
    if (j) --j;
    DP[i] = 3 * A[i] + DP[j] - A[j] + max(t - 2 * A[i], -2 * A[j + 1]);
    if (j) --j;
    DP[i] =
        min(DP[i], 3 * A[i] + DP[j] - A[j] + max(t - 2 * A[i], -2 * A[j + 1]));
  }
  cout << DP[n] + e - A[n];
  return 0;
}
