#include <bits/stdc++.h>
using namespace std;
long long dp[1234567];
int x[1234567];
long long const INF = 1LL << 60;
int main() {
  int n, ex, T;
  scanf("%d%d%d", &n, &ex, &T);
  for (int i = 1; i <= n; i++) scanf("%d", x + i);
  for (int i = 0; i <= n; i++) {
    dp[i] = INF;
  }
  dp[0] = 0;
  x[0] = 0;
  for (int i = 0; i < n; i++) {
    for (int j = i + 1; j <= n; j++) {
      long long first = dp[i] + x[i + 1] - x[i] + T;
      long long last = dp[i] + x[j] - x[i];
      long long back = last + x[j] - x[i + 1];
      back = std::max(back, first);
      last = back + x[j] - x[i + 1];
      dp[j] = std::min(dp[j], last);
    }
  }
  printf("%lld\n", ex - x[n] + dp[n]);
}
