#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
long long powmod(long long a, long long b) {
  long long res = 1;
  a %= mod;
  assert(b >= 0);
  for (; b; b >>= 1) {
    if (b & 1) res = res * a % mod;
    a = a * a % mod;
  }
  return res;
}
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
int n, r1, r2, r3, d;
long long f[1000066][2], g[1000066];
int a[1000066];
int main() {
  scanf("%d%d%d%d%d", &n, &r1, &r2, &r3, &d);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  f[0][1] = 1e18;
  for (int i = 1; i <= n; i++) {
    f[i][0] = min(f[i - 1][1] + 1ll * a[i] * r1 + r1 + r1 + 1ll * d * (i != n),
                  f[i - 1][1] + 1ll * r2 + 1ll * d * (i != n) + r1);
    f[i][0] = min(f[i][0], f[i - 1][0] + 1ll * r1 * a[i] + r3 + d * (i != n));
    f[i][1] = min(
        f[i - 1][0] + 1ll * a[i] * r1 + r1 + r1 + 3ll * d * (i != n) +
            2ll * d * (i == n),
        f[i - 1][0] + 1ll * r2 + 3ll * d * (i != n) + r1 + 2ll * d * (i == n));
    f[i][1] = min(f[i][1], f[i - 1][0] + 1ll * r1 * a[i] + r3 +
                               3ll * d * (i != n) + 2ll * d * (i == n));
    f[i][1] = min(f[i][1],
                  f[i - 1][1] + 1ll * a[i] * r1 + r1 + r1 + 3ll * d * (i != n));
    f[i][1] = min(f[i][1], f[i - 1][1] + 1ll * r2 + 3ll * d * (i != n) + r1);
  }
  for (int i = n; i > 0; i--) {
    g[i] =
        min(1ll * a[i] * r1 + r1 + 2ll * d * (i != 1) + r1 + 2ll * d * (i == n),
            1ll * r1 * a[i] + r3 + 2ll * d * (i != 1));
    g[i] = min(g[i], 1ll * r2 + 2ll * d * (i != 1) + r1 + 2ll * d * (i == n));
    g[i] += g[i + 1];
  }
  long long ans = min(g[1], f[n][0]);
  ans = min(ans, f[n][1]);
  for (int i = 1; i < n; i++) {
    long long w = min(1ll * a[i] * r1 + r1 + r1, 1ll * r1 * a[i] + r3);
    w = min(w, 1ll * r2 + r1);
    ans = min(ans, f[i - 1][0] + g[i + 1] + w);
    ans = min(ans, f[i - 1][1] + g[i + 1] + w);
  }
  printf("%lld\n", ans);
  return 0;
}
