#include <bits/stdc++.h>
using namespace std;
const int maxn = 100005;
int n, e, t, p[maxn], ti[maxn];
long long f[maxn];
int main() {
  cin >> n >> e >> t;
  for (int i = 1; i <= n; i++) cin >> p[i];
  for (int i = 1; i <= n; i++)
    for (int j = 0; j < i; j++) {
      long long tt = p[i] - p[j + 1] + p[i] - p[j + 1];
      if (tt < t) tt = t;
      tt += p[i] - p[j];
      if (f[i] == 0 || f[i] > tt + f[j]) f[i] = tt + f[j];
    }
  cout << f[n] + e - p[n] << endl;
  return 0;
}
