#include <bits/stdc++.h>
using namespace std;
const double EPS = 1e-9;
const double PI = acos(-1.0);
signed main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int64_t N, E, T;
  cin >> N >> E >> T;
  vector<int64_t> x(N);
  for (int64_t i = (int64_t)(0); i < (int64_t)(N); i++) cin >> x[i];
  sort((x.begin()), (x.end()));
  int64_t ans = x[0] + E - x[N - 1];
  int64_t xpos = 0;
  while (xpos < N) {
    int64_t nowpos = x[xpos];
    while (xpos < N - 1) {
      int64_t D = x[xpos + 1] - nowpos;
      if (max(D * 3, T + D) <= 2 * T + D)
        xpos++;
      else
        break;
    }
    int64_t endpos = x[xpos++];
    int64_t D = endpos - nowpos;
    ans += min(max(D * 3, T + D), 2 * T + D);
    if (xpos < N) ans += x[xpos] - x[xpos - 1];
  }
  cout << ans << endl;
  return 0;
}
