#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1.0);
const int INF = 1000 * 1000 * 1000 + 7;
const long long LINF = INF * (long long)INF;
const int MAX = 1000 * 1000 + 47;
int n, e, t;
int X[MAX];
long long dp[MAX];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, e, t;
  cin >> n >> e >> t;
  for (int i = (0); i < (n); i++) {
    cin >> X[i];
  }
  for (int i = (0); i < (n + 1); i++) dp[i] = INF;
  dp[0] = 0;
  int p = 0;
  long long minn = LINF;
  if (X[0] > t) {
    p++;
    minn = 0;
  }
  for (int i = (1); i < (n + 1); i++) {
    while (2 * (X[i - 1] - X[p]) > t) {
      minn = min(dp[p] - 2 * X[p], minn);
      p++;
    }
    dp[i] = minn + 2 * X[i - 1];
    dp[i] = min(dp[i], dp[p] + t);
  }
  cout << dp[n] + e;
}
