#include <bits/stdc++.h>
using namespace std;
const int maxn = 1000005;
long long N, r1, r2, r3, d, a[maxn];
long long f[maxn][2];
long long mshot(int i) {
  long long re = min(1ll * a[i] * r1 + r3, 1ll * (a[i] + 1) * r3);
  re = min(re, min(r2, min(1ll * (a[i] + 1) * r1, 1ll * a[i] * r3 + r1)) +
                   min(r1, min(r2, r3)));
  return re;
}
int stk[30], top = 0;
void mput(long long x) {
  stk[++top] = x % 10, x /= 10;
  while (x) stk[++top] = x % 10, x /= 10;
  while (top) putchar(stk[top--] + '0');
}
int main() {
  scanf("%lld%lld%lld%lld%lld", &N, &r1, &r2, &r3, &d);
  for (int i = 1; i <= N; i++) scanf("%lld", &a[i]);
  f[0][0] = f[0][1] = -d;
  f[1][0] = min(1ll * a[1] * r1 + r3, 1ll * (a[1] + 1) * r3);
  f[1][1] = min(r2, min(1ll * (a[1] + 1) * r1, 1ll * a[1] * r3 + r1));
  for (int i = 2; i <= N; i++) {
    f[i][0] =
        min(1ll * a[i] * r1 + r3, 1ll * (a[i] + 1) * r3) +
        min(d + f[i - 1][0], 3ll * d + f[i - 1][1] + min(r1, min(r2, r3)));
    f[i][0] =
        min(f[i][0], min(r2, min(1ll * (a[i] + 1) * r1, 1ll * a[i] * r3 + r1)) +
                         min(r1, min(r2, r3)) + 3ll * d +
                         min(f[i - 1][0], f[i - 1][1] + min(r1, min(r2, r3))));
    f[i][1] = min(r2, min(1ll * (a[i] + 1) * r1, 1ll * a[i] * r3 + r1)) +
              f[i - 1][0] + d;
  }
  long long ans = f[N][0];
  long long sum = min(1ll * a[N] * r1 + r3, 1ll * (a[N] + 1) * r3);
  sum = min(sum, min(r2, min(1ll * (a[N] + 1) * r1, 1ll * a[N] * r3 + r1)) +
                     min(r1, min(r2, r3)) + 2ll * d);
  for (int i = N - 1; i >= 1; i--) {
    sum += mshot(i) + 2ll * d;
    ans = min(ans, sum + d + f[i - 1][0]);
  }
  printf("%lld\n", ans);
  return 0;
}
