#include <bits/stdc++.h>
using namespace std;
int _MAX(int a, int b) { return a > b ? a : b; }
int _MIN(int a, int b) { return a > b ? b : a; }
int a[100005];
long long dp[100005][2];
int main() {
  int n, E, T;
  long long ans = 0;
  scanf("%d%d%d", &n, &E, &T);
  for (int i = 0; i < n; ++i) scanf("%d", a + i);
  int i = 1;
  dp[0][0] = a[0];
  dp[0][1] = a[0] + T;
  while (i < n - 1) {
    dp[i][0] = dp[i - 1][1] + a[i] - a[i - 1];
    dp[i][1] = dp[i - 1][1] + a[i] - a[i - 1] + T;
    if (T >= (long long)2 * (a[i] - a[i - 1]))
      dp[i][1] = min(dp[i][1], dp[i - 1][0] + T + a[i] - a[i - 1]);
    else if (T >= a[i + 1] - a[i])
      dp[i][1] = min(dp[i][1], dp[i - 1][0] + (long long)3 * (a[i] - a[i - 1]));
    ++i;
  }
  printf("%lld\n", dp[n - 1][1] + E - a[n - 1]);
}
