#include <bits/stdc++.h>
using namespace std;
int n, t, x[100010];
void input() {
  cin >> n;
  cin >> x[n + 1] >> t;
  for (int i = 1; i <= n; i++) cin >> x[i];
}
void solve() {
  long long res = x[1];
  int cur = 1;
  for (int i = 1; i <= n; i++)
    if (i >= cur) {
      while (cur + 1 <= n and x[cur + 1] - x[i] <= t) cur++;
      res += 3LL * (x[cur] - x[i]) + max(0, t - 2 * (x[cur] - x[i]));
      res += x[cur + 1] - x[cur];
      cur++;
    }
  cout << res;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  input();
  solve();
  return 0;
}
