#include <bits/stdc++.h>
const long long maxn = 1e6 + 9, mod = 998244353, inf = 1e18;
long long Read() {
  long long x(0), f(1);
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    x = (x << 3ll) + (x << 1ll) + c - '0';
    c = getchar();
  }
  return x * f;
}
void Chkmin(long long &x, long long y) {
  if (y < x) x = y;
}
void Chkmax(long long &x, long long y) {
  if (y > x) x = y;
}
long long add(long long x, long long y) {
  return x += y, x >= mod ? x - mod : x;
}
long long dec(long long x, long long y) { return x -= y, x < 0 ? x + mod : x; }
long long mul(long long x, long long y) { return 1ll * x * y % mod; }
long long Pow(long long base, long long b) {
  long long ret(1);
  while (b) {
    if (b & 1) ret = mul(ret, base);
    base = mul(base, base);
    b >>= 1;
  }
  return ret;
}
long long n, R1, R2, R3, d;
long long a[maxn], f[maxn], g[maxn];
int main() {
  n = Read();
  R1 = Read();
  R2 = Read();
  R3 = Read();
  d = Read();
  for (long long i = 1; i <= n; ++i) {
    a[i] = Read();
  }
  g[0] = inf;
  long long z(std::min(R1, std::min(R2, R3)));
  for (long long i = 1; i <= n; ++i) {
    f[i] = g[i] = inf;
    long long nw(f[i - 1]);
    Chkmin(f[i], nw + a[i] * std::min(R1, R3) + R3 + d);
    Chkmin(f[i], nw + a[i] * std::min(R1, R3) + 2 * R1 + 3 * d);
    Chkmin(f[i], nw + R2 + z + 3 * d);
    Chkmin(g[i], nw + a[i] * std::min(R1, R3) + std::min(R3, 2 * R1) + d);
    Chkmin(g[i], nw + R2 + d + z);
    nw = g[i - 1];
    Chkmin(f[i], nw + 3 * d + a[i] * std::min(R1, R3) + std::min(R3, 2 * R1));
    Chkmin(f[i], nw + 3 * d + R2 + z);
    Chkmin(g[i], nw + 3 * d + R2 + z);
    Chkmin(g[i], nw + 3 * d + a[i] * std::min(R1, R3) + std::min(R3, 2 * R1));
  }
  f[n] -= d;
  long long ans(f[n]);
  long long sum(a[n] * std::min(R1, R3) + R3);
  for (long long i = n - 1; i >= 1; --i) {
    long long nw(
        std::min(R2 + z, a[i] * std::min(R1, R3) + std::min(R3, 2 * R1)));
    sum += 2 * d + nw;
    Chkmin(ans, f[i - 1] + sum);
  }
  printf("%lld\n", ans);
  return 0;
}
