#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 100;
const long long inf = 1e18;
long long x[maxn];
long long dp[maxn], seg[maxn * 4];
void add(int v, int l, int r, int i, long long val) {
  if (r - l == 1) {
    seg[v] = val;
    return;
  }
  int mid = (l + r) / 2;
  if (i < mid)
    add(v * 2, l, mid, i, val);
  else
    add(v * 2 + 1, mid, r, i, val);
  seg[v] = min(seg[v * 2], seg[v * 2 + 1]);
}
long long query(int v, int l, int r, int b, int e) {
  if (e <= l || r <= b) return inf;
  if (b <= l && r <= e) return seg[v];
  int mid = (l + r) / 2;
  return min(query(v * 2, l, mid, b, e), query(v * 2 + 1, mid, r, b, e));
}
int main() {
  long long n, E, T;
  cin >> n >> E >> T;
  for (int i = 1; i <= n; i++) cin >> x[i], x[i] *= 2;
  add(1, 0, n + 1, 0, -x[1] * 2);
  for (int i = 1; i <= n; i++) {
    int j = lower_bound(x + 1, x + n + 1, x[i] - T) - x;
    if (x[j] > x[i] - T) j--;
    dp[i] = min(query(1, 0, n + 1, 0, j) + x[i] * 2, dp[j] + T * 2);
  }
  cout << (dp[n] + E * 2) / 2 << endl;
}
