#include <bits/stdc++.h>
using namespace std;
int n, e, t, x[666666];
int main() {
  scanf("%d%d%d", &n, &e, &t);
  for (int i = 1; i <= n; i++) scanf("%d", x + i);
  long long ans = x[1];
  int pos = 0;
  x[0] = x[1];
  for (int i = 1; i <= n; i++) {
    int l = x[i] - x[pos];
    if (l < t) continue;
    if (l * 2 > (i - pos) * (long long)(t)) {
      int g = i - 1;
      int l2 = x[g] - x[pos];
      if (2 * l2 > t)
        ans += min(l2 * 3LL, (g - pos) * long long(t) + l2);
      else
        ans += (g - pos) * long long(t) + l2;
      pos = g;
    }
  }
  {
    int g = n;
    int l2 = x[g] - x[pos];
    if (2 * l2 > t)
      ans += min(l2 * 3LL, (g - pos) * long long(t) + l2);
    else
      ans += (g - pos) * long long(t) + l2;
    pos = g;
  }
  ans += e - x[n];
  cout << ans << "\n";
}
