#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
const int INF = MOD + 1;
const long double EPS = 1e-12;
template <class T>
T &chmin(T &a, const T &b) {
  return a = min(a, b);
}
template <class T>
T &chmax(T &a, const T &b) {
  return a = max(a, b);
}
int n, t, e;
vector<int> x;
long long dp[2222][2222];
long long solve(int p, int col) {
  if (dp[p][col] >= 0) return dp[p][col];
  long long res = 0;
  if (p == n - 1 && col == n) {
    res = e - x[n - 1];
  } else if (p == n - 1) {
    long long d = x[p] - x[col];
    long long tmp;
    if (d * 2 <= t)
      tmp = t;
    else
      tmp = d * 2;
    res = tmp + solve(n - 1, n);
  } else {
    long long dist = x[p + 1] - x[p];
    long long tmp;
    long long d = x[p] - x[col];
    if (d * 2 <= t)
      tmp = t;
    else
      tmp = d * 2;
    res = dist + min(solve(p + 1, col), solve(p + 1, p + 1) + tmp);
  }
  return dp[p][col] = res;
}
int main() {
  cin.sync_with_stdio(false);
  cout << fixed << setprecision(10);
  memset(dp, -1, sizeof(dp));
  cin >> n >> e >> t;
  if (n > 2000) return 1;
  x.resize(n);
  for (int i = (int)(0); i < (int)(n); i++) cin >> x[i];
  cout << x[0] + solve(0, 0) << endl;
  return 0;
}
