#include <bits/stdc++.h>
using namespace std;
int n, e, t;
vector<int> num;
long long work(int i, int j) {
  long long tmp = 0, xx = 0;
  for (int k = i; k < j; k++) {
    if ((num[j - 1] - num[i]) * 2 + xx < t) {
      tmp += (t - (num[j - 1] - num[i]) * 2 - xx);
      xx += (t - (num[j - 1] - num[i]) * 2 - xx);
    }
  }
  return tmp;
}
int main() {
  scanf("%d%d%d", &n, &e, &t);
  num.clear();
  for (int x, i = 0; i < n; i++) {
    scanf("%d", &x);
    num.push_back(x);
  }
  long long sum = 0;
  sum += num[0] + e - num[n - 1];
  for (int j, i = 0; i < n; i = j) {
    long long tmp = 0;
    j = i;
    while (j < n && num[j] - num[i] < t) j++;
    tmp += 3LL * (num[j - 1] - num[i]);
    tmp += work(i, j);
    if (j < n) {
      long long temp = 3LL * (num[j] - num[i]);
      temp += work(i, j + 1);
      if (tmp > temp) {
        j++;
        sum += temp;
      } else
        sum += tmp;
    } else {
      sum += tmp;
    }
    if (j < n) sum += num[j] - num[j - 1];
  }
  cout << sum << endl;
  return 0;
}
