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