#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9 + 1;
long long n, t, e, st, pos[100005], dist;
long long ans = 0;
int main() {
  scanf("%d%d%d", &n, &e, &t);
  for (int i = 0; i < n; i++) scanf("%d", &pos[i]);
  ans += pos[0] + e - pos[n - 1];
  while (st < n - 1) {
    int ed = st;
    dist = 0;
    for (int i = st + 1; i < n; i++) {
      dist += pos[i] - pos[i - 1];
      if (dist > t) {
        dist -= pos[i] - pos[i - 1];
        ed = i - 1;
        break;
      } else if (i == n - 1)
        ed = 1;
    }
    ans += 3 * dist;
    if (2 * dist < t) ans += (ed - st + 1) * (t - dist * 2);
    if (ed < n - 1) ans += pos[ed + 1] - pos[ed];
    if (ed == n - 2) ans += t;
    st = ed + 1;
  }
  if (n == 1) ans += t;
  printf("%lld\n", ans);
  return 0;
}
