#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
const int mod1 = 998244353;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  long long n, T, e;
  cin >> n >> e >> T;
  vector<long long> x(n);
  for (int i = 0; i < (n); ++i) cin >> x.at(i);
  long long ans = x.at(0);
  vector<bool> b(n);
  for (int i = 0; i < (n); ++i) {
    if (i == n - 1) {
      if (!b.at(i)) ans += T;
      ans += e - x.at(i);
      break;
    }
    if (b.at(i)) {
      ans += x.at(i + 1) - x.at(i);
    } else {
      if ((x.at(i + 1) - x.at(i)) * 2 - T >= T)
        ans += T;
      else {
        int k = i;
        for (int j = i + 1; j < n; ++j) {
          if ((x.at(j) - x.at(i)) * 2 < T) {
            k = j;
            b.at(j) = true;
          } else {
            if ((T - (x.at(j - 1) - x.at(i)) * 2) >
                (x.at(j) - x.at(j - 1)) * 2 - T) {
              k = j;
              b.at(j) = true;
            }
            break;
          }
        }
        ans += (x.at(k) - x.at(i)) * 2 +
               max(T - (x.at(k) - x.at(i)) * 2, (long long)0);
      }
      ans += x.at(i + 1) - x.at(i);
    }
  }
  cout << ans << endl;
}
