#include <bits/stdc++.h>
using namespace std;
template <class T>
bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
bool chmin(T &a, const T &b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
ostream &operator<<(ostream &os, const vector<T> &t) {
  os << "[";
  for (__typeof((t).begin()) it = (t).begin(); it != (t).end(); it++) {
    if (it != t.begin()) os << ",";
    os << *it;
  }
  os << "]";
  return os;
}
template <class T>
ostream &operator<<(ostream &os, const set<T> &t) {
  os << "{";
  for (__typeof((t).begin()) it = (t).begin(); it != (t).end(); it++) {
    if (it != t.begin()) os << ",";
    os << *it;
  }
  os << "}";
  return os;
}
template <class S, class T>
ostream &operator<<(ostream &os, const pair<S, T> &t) {
  return os << "(" << t.first << "," << t.second << ")";
}
template <class S, class T>
pair<S, T> operator+(const pair<S, T> &s, const pair<S, T> &t) {
  return pair<S, T>(s.first + t.first, s.second + t.second);
}
template <class S, class T>
pair<S, T> operator-(const pair<S, T> &s, const pair<S, T> &t) {
  return pair<S, T>(s.first - t.first, s.second - t.second);
}
const int INF = 1 << 28;
const double EPS = 1e-8;
const int MOD = 1000000007;
int T, n, e, t;
int main(int argc, char *argv[]) {
  ios::sync_with_stdio(false);
  cin >> n >> e >> t;
  vector<int> x(n + 2);
  for (int i = 1; i <= (int)(n); i++) cin >> x[i];
  x[n + 1] = e;
  int captured = 0;
  long long int ans = x[1];
  for (int i = 1; i <= (int)(n); i++) {
    long long int d = x[i] - x[captured + 1];
    long long int nd = x[i + 1] - x[i];
    if (i == n || 2 * t - 2 * d < 2 * nd) {
      ans += 3 * d + max(0ll, t - 2 * d) + nd;
      captured = i;
    }
  }
  cout << ans << endl;
  return 0;
}
