#include <bits/stdc++.h>
using namespace std;
int n, m, t, x[100010], f[100010];
int main() {
  int i, j, k;
  scanf("%d%d%d", &n, &m, &t);
  for (i = 1; i <= n; i++) scanf("%d", &x[i]);
  for (i = 1, j = 0, k = 2e9; i <= n; i++) {
    for (; 2 * (x[i] - x[j + 1]) > t; j++)
      k = ((k) < (f[j] - 2 * x[j + 1]) ? (k) : (f[j] - 2 * x[j + 1]));
    f[i] = ((k + 2 * x[i]) < (f[j] + t) ? (k + 2 * x[i]) : (f[j] + t));
  }
  cout << (long long)f[n] + m << "\n";
  return 0;
}
