#include <bits/stdc++.h>
using namespace std;
int N, E, T, x[100009];
long long dp[100009], INF = 1LL << 50;
multiset<long long> S1, S2;
void push(int lin, long long val) {
  if (lin == 1)
    S1.insert(val);
  else
    S2.insert(val);
}
void pop(int lin, long long val) {
  if (lin == 1)
    S1.erase(S1.find(val));
  else
    S2.erase(S2.find(val));
}
long long getVal(int lin, int k) {
  if (lin == 1) return (long long)dp[k - 1] - x[k] - x[k] - x[k - 1];
  return (long long)dp[k - 1] - x[k - 1] + T;
}
int main() {
  scanf("%d %d %d", &N, &E, &T);
  for (int i = 1; i <= N; i++) scanf("%d", &x[i]);
  int k = 1;
  for (int i = 1; i <= N; i++) {
    while (2 * (x[i] - x[k]) >= T) {
      push(1, getVal(1, 1));
      pop(2, getVal(2, k));
      k++;
    }
    push(2, getVal(2, i));
    long long val1 = INF, val2 = INF;
    if (!S1.empty()) val1 = (*S1.begin()) + 3LL * x[i];
    if (!S2.empty()) val2 = (*S2.begin()) + x[i];
    dp[i] = min(val1, val2);
  }
  printf("%lld\n", dp[N] + E - x[N]);
  return 0;
}
