#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 5;
int n, e, t;
int x[maxn];
long long dp[maxn];
int main() {
  scanf("%d%d%d", &n, &e, &t);
  dp[0] = 0;
  for (int i = (1); i <= (n); ++i) scanf("%d", x + i);
  for (int i = 1, j = 1; i <= n; ++i) {
    if (2 * (x[i] - x[1]) <= t)
      dp[i] = t;
    else {
      dp[i] = -2 * x[1];
      for (; 2 * (x[i] - x[j + 1]) > t; ++j) {
        dp[i] = min(dp[i], dp[j] - 2 * x[j + 1]);
      }
      dp[i] += 2 * x[i];
      dp[i] = min(dp[i], dp[j] + t);
    }
  }
  printf("%lld\n", dp[n] + e);
  return 0;
}
