#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100010;
const long long INF = 1LL << 50;
inline int read() {
  int x = 0, f = 1;
  char ch = getchar();
  for (; !isdigit(ch); ch = getchar())
    if (ch == '-') f = -1;
  for (; isdigit(ch); ch = getchar()) x = (x * 10) + (ch ^ 48);
  return x * f;
}
int n, e, T, d[MAXN], l, r;
long long dp[MAXN], pre;
pair<long long, int> q[MAXN * 20];
int main() {
  n = read();
  e = read(), T = read();
  for (int i = 1; i <= n; i++) d[i] = read();
  dp[0] = 0;
  l = r = 0;
  q[++r] = make_pair(0, d[1]);
  pre = INF;
  int j = 0;
  for (int i = 1; i <= n; i++) {
    dp[i] = INF;
    pair<long long, int> u = q[l + 1];
    while (2 * (d[i] - u.second) > T) {
      l++;
      if (l != r)
        u = q[l + 1];
      else
        break;
    }
    while (2 * (d[i] - d[j + 1]) > T) {
      pre = min(pre, dp[j] - (d[j + 1] << 1));
      j++;
    }
    if (l != r) dp[i] = u.first + T;
    dp[i] = min(dp[i], pre + (d[i] << 1));
    while (l != r && dp[i] > q[r].first) r--;
    q[++r] = make_pair(dp[i], d[i + 1]);
  }
  printf("%lld\n", dp[n] + e);
  return 0;
}
