#include <bits/stdc++.h>
const int N = 1000000 + 10;
int n;
int r1, r2, r3, d;
int a[N];
long long b[N][2], s[N][2];
void Init() {
  scanf("%d", &n);
  scanf("%d%d%d%d", &r1, &r2, &r3, &d);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
}
void Prework() {
  for (int i = 1; i <= n; i++) {
    b[i][0] = 1ll * std::min(r1, r3) * a[i] + r3;
    b[i][1] = std::min(1ll * r2, 1ll * std::min(r1, r3) * a[i] + r1) +
              std::min(r1, std::min(r2, r3));
    s[i][0] = std::min(s[i - 1][0] + b[i][0], 1ll << 61);
    s[i][1] = s[i - 1][1] + std::min(b[i][0], b[i][1]);
  }
}
void Solve() {
  long long lf[2] = {-d, b[1][0]};
  long long minf = lf[0];
  long long ans = 1ll * d * (n - 1) + s[n][0];
  for (int i = 2; i <= n; i++) {
    long long nf =
        d + std::min(lf[1] + b[i][0], minf + 3ll * d * (i - 1) + s[i][1]);
    lf[0] = lf[1];
    lf[1] = nf;
    minf = std::min(minf, lf[0] - 3ll * d * (i - 1) - s[i - 1][1]);
    if (i < n) {
      ans = std::min(ans, lf[0] + 1ll * d * ((n - i + 1) * 2 - 1) + b[n][0] +
                              s[n - 1][1] - s[i - 1][1]);
      ans = std::min(ans, lf[0] + 1ll * d * ((n - i + 1) * 2 + 1) + b[n][1] +
                              s[n - 1][1] - s[i - 1][1]);
    }
  }
  printf("%lld\n", std::min(lf[1], ans));
}
int main() {
  Init();
  Prework();
  Solve();
  return 0;
}
