#include <bits/stdc++.h>
using namespace std;
const long long MAXN = 1e5 + 10;
long long a[MAXN];
long long n, e, t;
int32_t main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  cin >> n >> e >> t;
  for (long long i = 0; i < n; ++i) cin >> a[i];
  a[n] = 2e9;
  long long res = a[0];
  long long point = 0;
  for (long long i = 0; i < n; ++i) {
    if (a[i + 1] - a[point] > t) {
      res += max(a[i] - a[point], t - a[i] + a[point]) + a[i] - a[point];
      point = i + 1;
    }
    if (i < n - 1) res += a[i + 1] - a[i];
  }
  res += e - a[n - 1];
  cout << res;
  return 0;
}
