#include <bits/stdc++.h>
using namespace std;
long long n, e, t;
long long f(const vector<long long> &a, int m) {
  long long res = m * t;
  long long res1 =
      res + a[n - 1] + (m == n ? 0 : t) + abs(a[n - 1] - a[m]) + abs(a[m] - e);
  long long res2 = res + a[n - 1] + abs(a[n - 1] - a[m]);
  res2 = (a[m] + t < res2 ? res2 : a[m] + t);
  res2 += abs(a[n - 1] - a[m]) + abs(a[n - 1] - e);
  return min(res1, res2);
}
int main() {
  cin >> n >> e >> t;
  vector<long long> a(n + 1);
  for (int i = 0; i < n; i++) cin >> a[i];
  a[n] = e;
  long long res = a[0];
  int l = 0;
  for (int i = 1; i < n; i++) {
    long long loc1 = 2 * (a[i - 1] - a[l]);
    loc1 = (loc1 < t ? t : loc1) + (a[i] - a[l]) + t;
    long long loc2 = 2 * (a[i] - a[l]);
    loc2 = (loc2 < t ? t : loc2) + (a[i] - a[l]);
    if (loc1 < loc2) {
      res += loc1 - t;
      l = i;
    }
  }
  long long loc1 = 2 * (a[n - 1] - a[l]);
  loc1 = (loc1 < t ? t : loc1) + abs(e - a[l]);
  res += loc1;
  cout << res;
  return 0;
}
