#include <bits/stdc++.h>
template <typename T>
void swap(T &x, T &y) {
  T t = x;
  x = y;
  y = t;
  return;
}
template <typename T>
T abs(T x) {
  return (0 <= x ? x : -x);
}
template <typename T>
T max(T a, T b) {
  return (b <= a ? a : b);
}
template <typename T>
T min(T a, T b) {
  return (a <= b ? a : b);
}
template <typename T>
bool setmin(T &a, T b) {
  if (a <= b) {
    return false;
  } else {
    a = b;
    return true;
  }
}
template <typename T>
bool setmax(T &a, T b) {
  if (b <= a) {
    return false;
  } else {
    a = b;
    return true;
  }
}
template <typename T>
T gcd(T a, T b) {
  return (b == 0 ? a : gcd(b, a % b));
}
template <typename T>
T lcm(T a, T b) {
  return a / gcd(a, b) * b;
}
long long signed int n, e, t, x[100002];
long long signed int dp[100001];
int m[100001];
const long long signed int MAX = 1000000000000000LL;
std::multiset<long long signed int> ms;
long long signed int mi1_v = MAX;
long long signed int mi1(int i) {
  for (int j = (m[i - 1]); j < (m[i]); j++) {
    setmin(mi1_v, dp[j] - 2 * x[j + 1]);
  }
  return mi1_v;
}
long long signed int mi2(int i) {
  for (int j = (m[i - 1]); j < (m[i]); j++) {
    ms.erase(dp[j]);
  }
  ms.insert(dp[i - 1]);
  return *(ms.rbegin());
}
int main() {
  scanf("%lld%lld%lld", &n, &e, &t);
  for (int i = (1); i <= (n); i++) {
    scanf("%lld", &x[i]);
  }
  int mm = 0;
  for (int i = (1); i <= (n); i++) {
    while ((x[i] - x[mm + 1]) * 2 > t) {
      mm++;
    }
    m[i] = mm;
  }
  for (int i = (1); i <= (n); i++) {
    dp[i] = min(mi1(i) + 2 * x[i], mi2(i) + t);
  }
  printf("%lld\n", dp[n] + e);
  return 0;
}
