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