#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:60777216")
using namespace std;
int n, e, t;
int x[222222];
long long r[222222];
int p[222222];
long long solve(int from, int to) {
  return max(0ll + x[to] - x[from] + x[to] - x[from + 1],
             0ll + x[from + 1] - x[from] + t) +
         x[to] - x[from + 1];
}
int main() {
  cin >> n >> e >> t;
  for (int i = (0); i < (n); i++) scanf("%d", x + i + 1);
  for (int i = (1); i < (n + 1); i++) {
    int prev = p[i - 1];
    r[i] = r[prev] + solve(prev, i);
    while (prev + 1 < i && r[i] > r[prev + 1] + solve(prev + 1, i)) {
      prev++;
      r[i] = r[prev] + solve(prev, i);
    }
    p[i] = prev;
  }
  cout << r[n] + e - x[n] << endl;
  return 0;
}
