#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];
long long dp[MAXN], pre;
queue<pair<long long, int> > q;
int main() {
  n = read();
  e = read(), T = read();
  for (int i = 1; i <= n; i++) d[i] = read();
  dp[0] = 0;
  q.push(make_pair(0, d[1]));
  pre = INF;
  for (int i = 1; i <= n; i++) {
    dp[i] = INF;
    pair<long long, int> u = q.front();
    while (2 * (d[i] - u.second) > T) {
      pre = min(pre, u.first - 2 * u.second);
      q.pop();
      if (!q.empty()) u = q.front();
    }
    if (!q.empty()) dp[i] = u.first + T;
    dp[i] = min(dp[i], pre + (d[i] << 1));
    q.push(make_pair(dp[i], d[i + 1]));
  }
  printf("%I64d\n", dp[n] + e);
  return 0;
}
