#include <bits/stdc++.h>
long long MOD = 1e9 + 7;
using namespace std;
int in() {
  int x;
  scanf("%d", &x);
  return x;
}
long long lin() {
  long long x;
  scanf("%lld", &x);
  return x;
}
template <typename A, size_t NNN, typename T>
void Fill(A (&array)[NNN], const T &val) {
  fill((T *)array, (T *)(array + NNN), val);
}
int main() {
  long long n = lin(), e = lin(), t = lin();
  long long x[100001];
  for (int i = 0; i < n; i++) x[i] = lin();
  int now = 0;
  long long ans = x[0];
  while (now < n) {
    int go = (upper_bound(x, x + n, x[now] + t)) - x - 1;
    if (go < n)
      ans += (x[go] - x[now]) * 3 + max((long long)0, t - (x[go] - x[now]) * 2);
    else {
      ans += (x[go - 1] - x[now]) * 3 + e - x[n - 1];
      cout << ans;
      return 0;
    }
    if (go + 1 < n) {
      ans += x[go + 1] - x[go];
      now = go + 1;
    } else {
      cout << ans + e - x[n - 1];
      return 0;
    }
  }
}
