#include <bits/stdc++.h>
using namespace std;

int main() {
  int N, M, T; cin >> N >> M >> T;
  int ans = 0;
  int pv = 0;
  for (int i = 0; i < N; ++i) {
    int a; cin >> a;
    ans += max(0, max(0, a - M) - pv);
    pv = min(T, a + M);
  }
  cout << ans + T - pv << endl;
  return 0;
}

