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