#include <bits/stdc++.h>
using namespace std;
long long int x[100003];
long long int dp[100003];
long long int mn1[100003], mn2[100003];
int main(void) {
  int n, e, t;
  scanf("%d%d%d", &n, &e, &t);
  int i, j;
  for (i = 1; i <= n; i++) scanf("%lld", &x[i]);
  sort(x + 1, x + n + 1);
  dp[0] = 0;
  mn1[0] = mn2[0] = 0;
  for (i = 1; i <= n; i++) {
    dp[i] =
        dp[mn1[i - 1]] + max(2 * (x[i] - x[mn1[i - 1] + 1]), (long long int)t);
    dp[i] = min(dp[i], dp[mn2[i - 1]] + max(2 * (x[i] - x[mn2[i - 1] + 1]),
                                            (long long int)t));
    mn1[i] = dp[mn1[i - 1]] < dp[i] ? mn1[i - 1] : i;
    mn2[i] = (dp[mn2[i - 1]] - 2 * x[mn2[i - 1] + 1] < dp[i] - 2 * x[i + 1])
                 ? mn2[i - 1]
                 : i;
  }
  printf("%lld\n", e + dp[n]);
  return 0;
}
