#include <bits/stdc++.h>
using namespace std;
int chh;
const int N = 100005;
int n, e, t;
int a[N], f[N];
int main() {
  int ans, p, tim, id, tmp, m, pre;
  while (~scanf("%d %d %d", &n, &e, &t)) {
    a[0] = 0;
    for (int i = (1); i <= (n); i++) scanf("%d", &a[i]);
    memset(f, -1, sizeof(f));
    ans = 0, id = 0;
    for (int i = (1); i <= (n); i++) {
      ans += a[i] - a[i - 1];
      if (f[i] == -1)
        tim = t, f[i] = ans, id = i;
      else {
        if (f[i] + t <= ans)
          continue;
        else
          tim = f[i] + t - ans;
      }
      pre = ans + tim;
      for (p = id + 1; p <= n; p++) {
        tmp = a[p] - a[i];
        if (tmp * 2 <= tim)
          f[p] = ans + tmp;
        else {
          m = ans + tmp * 3;
          if (tmp < t) m += t - tmp;
          if (m <= pre + tmp + tim)
            f[p] = ans + tmp;
          else
            break;
        }
        if (tmp * 2 <= tim)
          pre = ans + tim;
        else
          pre = ans + tmp * 2;
      }
      id = p - 1;
      ans = pre;
    }
    ans += e - a[n];
    printf("%d\n", ans);
  }
  return 0;
}
