#include <bits/stdc++.h>
using namespace std;
int n;
long long t;
long long e;
vector<long long> x;
long long dp[100010];
long long rec(int end_x) {
  if (dp[end_x] != -1) return dp[end_x];
  if (end_x == n) {
    return (dp[end_x] = e - x[n]);
  }
  auto ite = lower_bound(x.begin(), x.end(), x[end_x + 1] + t / 2 + t % 2);
  int i = ite - x.begin();
  long long v1 = (1LL << 62);
  long long v2 = v1;
  if (i < n + 1) {
    v1 = rec(i) + (x[i] - x[end_x + 1]) * 3;
  }
  i--;
  if (i < n + 1) {
    v2 = rec(i) + (x[i] - x[end_x + 1]) + t;
  }
  return (dp[end_x] = min(v1, v2) + x[end_x + 1] - x[end_x]);
}
int main() {
  fill(dp, dp + 100010, -1LL);
  cin >> n >> e >> t;
  x.assign(n + 1, 0);
  x[0] = 0;
  for (int i = 1; i <= n; i++) {
    cin >> x[i];
  }
  cout << rec(0) << endl;
  return 0;
}
