#include <bits/stdc++.h>
using namespace std;
ifstream fin("contest.in");
ofstream fout("contest.out");
long long n, e, t, x[100000 + 1], d, sum;
long long maxim(long long A, long long B) {
  if (A > B)
    return A;
  else
    return B;
}
int main() {
  fin >> n >> e >> t;
  for (int i = 1; i <= n; i++) fin >> x[i];
  sum = x[1];
  x[n + 1] = e;
  for (int i = 1; i <= n; i++) {
    int ind = i + 1;
    d = x[ind] - x[i];
    while (d < t && ind <= n) {
      ind++;
      d = x[ind] - x[i];
    }
    ind--;
    if (i == ind)
      sum += t, sum += x[i + 1] - x[i];
    else {
      d = x[ind] - x[i];
      sum += maxim(2 * d, t) + d;
      sum += x[ind + 1] - x[ind];
      i = ind;
    }
  }
  fout << sum;
  return 0;
}
