#include <bits/stdc++.h>
using namespace std;
long long p[2123];
long long cache[2123][2123];
bool seen[2123][2123];
long long n, e, t;
long long dp(long long x, long long y) {
  if (x == n) return 0;
  if (seen[x][y]) return cache[x][y];
  seen[x][y] = true;
  long long ans1 = -1, ans2 = -1;
  if (x + 1 < n) ans1 = p[x + 1] - p[x] + dp(x + 1, y);
  ans2 = p[x] - p[y] + max(0ll, t - 2 * (p[x] - p[y])) + p[x + 1] - p[y] +
         dp(x + 1, x + 1);
  if (ans1 > -1) ans2 = min(ans2, ans1);
  cache[x][y] = ans2;
  return ans2;
}
int main() {
  cin >> n;
  cin >> p[n] >> t;
  for (int i = 0; i < n; i++) cin >> p[i];
  cout << dp(0, 0) + p[0] << '\n';
  return 0;
}
