#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100005;
const long long int INF = 1000000000000000000ll;
int x[MAXN];
long long int dp[MAXN];
long long int f(int p1, int p2, int t) {
  long long int t1 = x[p2] - x[p1];
  if (2 * t1 > t) return 3 * t1;
  return 3 * t1 + (t - 2 * t1);
}
int main() {
  int n, e, t;
  scanf("%d %d %d", &n, &e, &t);
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &x[i]);
  }
  for (int i = 1; i <= n; ++i) {
    dp[i] = INF;
    for (int j = 0; j < i; ++j) {
      long long int cval = dp[j] + (x[j + 1] - x[j]) + f(j + 1, i, t);
      dp[i] = min(dp[i], cval);
    }
  }
  cout << dp[n] + (e - x[n]) << "\n";
  return 0;
}
