#include <bits/stdc++.h>
using namespace std;
int minim[100000], maxim[100000];
long long c[100000], dp[100000];
int n;
long long e, t;
long long mxm(long long a, long long b);
int main() {
  cin >> n >> e >> t;
  int prec = -1e9, m = 0, cit;
  while (n--) {
    cin >> cit;
    if (cit - prec > t) {
      m++;
      minim[m] = cit;
    }
    maxim[m] = cit;
    prec = cit;
  }
  for (int i = 1; i <= m; i++)
    c[i] = mxm(2ll * (maxim[i] - minim[i]), t) + maxim[i] - minim[i];
  for (int i = 1; i <= m; i++)
    dp[i] = dp[i - 1] + c[i] + 1ll * (minim[i] - maxim[i - 1]);
  cout << (long long)dp[m] + e - maxim[m];
  return 0;
}
long long mxm(long long a, long long b) {
  if (a > b) return a;
  return b;
}
