#include <bits/stdc++.h>
using namespace std;
long long n, e, t, ans, cnt, bo, a[100005];
int main() {
  int i, j;
  cin >> n >> e >> t;
  for (i = 0; i < n; i++) {
    scanf("%lld", &a[i]);
  }
  a[n] = e;
  ans = a[0];
  for (i = 0; i < n;) {
    cnt = 1;
    for (j = i; j < n; j++) {
      if (i > j)
        bo = max(0LL, t - (a[j - 1] - a[i]) * 2);
      else
        bo = 0;
      if (cnt * t < (a[j] - a[i]) * 2 + bo) break;
      cnt++;
    }
    ans += (a[j - 1] - a[i]) * 2;
    ans += a[j] - a[i];
    ans += max(0LL, t - (a[j - 1] - a[i]) * 2);
    i = j;
  }
  cout << ans << endl;
  return 0;
}
