#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100005;
int x[MAXN];
long long int dp[MAXN];
long long int f(int p1, int p2, long long 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]);
  }
  int prev = 0;
  for (int i = 1; i <= n; ++i) {
    while (prev + 1 < i) {
      long long int v1 = dp[prev] + (x[prev + 1] - x[prev]) + f(prev + 1, i, t);
      prev++;
      long long int v2 = dp[prev] + (x[prev + 1] - x[prev]) + f(prev + 1, i, t);
      prev--;
      if (v2 <= v1)
        prev++;
      else
        break;
    }
    long long int cval = dp[prev] + (x[prev + 1] - x[prev]) + f(prev + 1, i, t);
    dp[i] = cval;
  }
  dp[n] = dp[prev] + (x[prev + 1] - x[prev]) + f(prev + 1, n, t);
  long long int ans = dp[n] + (e - x[n]);
  printf("%lld\n", ans);
  return 0;
}
