#include <bits/stdc++.h>
using namespace std;
long long dp[2005];
long long x[2005];
int main() {
  int n;
  long long t, e;
  cin >> n >> e >> t;
  for (int i = 1; i <= n; ++i) {
    cin >> x[i];
  }
  dp[0] = 0;
  for (int i = 1; i <= n; ++i) {
    dp[i] = 1LL << 60;
    for (int j = 1; j <= i; ++j) {
      long long extra = x[i] - x[i - j];
      extra += (x[i] - x[i - j + 1]);
      extra += max(0LL, (t - (extra - (x[i - j + 1] - x[i - j]))));
      extra += (x[i] - x[i - j + 1]);
      dp[i] = min(dp[i], dp[i - j] + extra);
    }
  }
  cout << dp[n] + (e - x[n]) << "\n";
  return 0;
}
