#include <bits/stdc++.h>
using namespace std;
const int MXN = 1e5 + 1;
int N, T, E;
long long xs[MXN];
long long t = 0;
int main() {
  cin >> N >> E >> T;
  for (int x = 0; x < N; x++) cin >> xs[x];
  long long last = 0;
  for (int x = 0; x < N; x++) {
    int xsrt = x;
    t += xs[x] - last;
    set<long long> ts;
    ts.insert(T);
    while (x + 1 < N && xs[x + 1] - xs[xsrt] <= T)
      x++, ts.insert(xs[x] - xs[xsrt] + T);
    long long tmp = 2 * (xs[x] - xs[xsrt]);
    last = xs[xsrt];
    for (int i = xsrt; i <= x; i++) {
      tmp += xs[i] - last;
      if (tmp < *ts.begin()) {
        tmp = *ts.begin();
      }
      ts.erase(ts.begin());
      last = xs[i];
    }
    t += tmp;
  }
  cout << (E - last) + t << "\n";
}
