#include <bits/stdc++.h>
using namespace std;
int n, e, T;
long long dp[100010];
int dis[100010];
long long inf = 1LL << 60;
int main() {
  scanf("%d%d%d", &n, &e, &T);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &dis[i]);
  }
  for (int x = 1; x <= n; x++) {
    dp[x] = inf;
    for (int i = 0; i < x; i++) {
      long long ans =
          dp[i] + 3LL * (dis[x] - dis[i + 1]) + (dis[i + 1] - dis[i]);
      ans += max(0LL, (long long)T - 2 * (dis[x] - dis[i + 1]));
      dp[x] = min(dp[x], ans);
    }
  }
  printf("%lld\n", dp[n] + e - dis[n]);
}
