#include <bits/stdc++.h>
using namespace std;
int main(void) {
  long long int n, e, t;
  long long int cost = 0;
  vector<int> x;
  cin >> n >> e >> t;
  for (int i = 0; i < n; i++) {
    int temp;
    cin >> temp;
    x.push_back(temp);
  }
  cost = x[0];
  for (int i = 0; i < n - 1; i++) {
    int temp;
    temp = 0;
    if (x[i + 1] - x[i] <= t / 2) {
      temp += x[i - 1] - x[i];
      for (int j = i + 1; j < n - 1; j++) {
        if (x[j + 1] - x[j] + temp <= t / 2) {
          temp += x[j + 1] - x[j];
          i = j - 1;
        } else {
          break;
        }
      }
    }
    cost += 2 * temp + (t - temp);
  }
  cost += x[n - 1] + (e - x[n - 1]);
  cout << cost << endl;
  return 0;
}
