#include <bits/stdc++.h>
const double PI = acos(-1.0);
const int DIR = 4;
const int X[] = {1, 0, -1, 0};
const int Y[] = {0, 1, 0, -1};
using namespace std;
const int N = 1e5 + 123;
long long n, t, e, dp[N], x[N];
long long calc(int l, int r) {
  return dp[l] + 3 * (x[r] - x[l]) + max(0ll, t - 2 * (x[r] - x[l]));
}
int main() {
  cin >> n;
  cin >> e >> t;
  for (int i = 1; i <= n; i++) cin >> x[i];
  dp[1] = x[1];
  x[n + 1] = e;
  for (int i = 1, j = 1; i <= n; i++) {
    while (j + 1 <= i && calc(j, i) > calc(j + 1, i)) j++;
    dp[i + 1] = calc(j, i) + x[i + 1] - x[i];
  }
  cout << dp[n + 1];
  return 0;
}
