#include <bits/stdc++.h>
using namespace std;
long long arr[1001001];
long long perfect[1001000];
long long cum_perfect[1001000];
long long lazy[1001000];
const long long INF = 1987654321LL * 1987654321LL;
long long cum_lazy[1001000];
int main() {
  int n;
  long long pistol, lazer, awp, d;
  scanf("%d %lld %lld %lld %lld", &n, &pistol, &lazer, &awp, &d);
  long long ans = 0;
  long long dmg_one = min(awp, min(pistol, lazer));
  for (int i = 1; i <= n; i++) {
    scanf("%lld", &arr[i]);
    perfect[i] = min(awp, pistol) * arr[i] + awp;
    lazy[i] =
        min(min(pistol, awp) * arr[i] + min(2 * dmg_one, awp), lazer + dmg_one);
    cum_perfect[i] = cum_perfect[i - 1] + perfect[i];
    if (i >= 2) {
      cum_perfect[i] = min(cum_perfect[i],
                           cum_perfect[i - 2] + lazy[i] + lazy[i - 1] + 2 * d);
    }
    cum_lazy[i] = cum_lazy[i - 1] + lazy[i];
  }
  ans = cum_perfect[n];
  for (int k = 1; k <= n; k++) {
    long long now = 0;
    now = cum_perfect[k - 1];
    now += cum_lazy[n - 1] - cum_lazy[k - 1];
    now += perfect[n];
    now += (d) * (n - k);
    ans = min(ans, now);
  }
  for (int k = 1; k <= n; k++) {
    long long now = 0;
    now = cum_perfect[k - 1];
    now += cum_lazy[n - 1] - cum_lazy[k - 1];
    now += lazy[n] + d + d;
    now += (d) * (n - k);
    ans = min(ans, now);
  }
  if (n >= 2) {
    long long now = 0;
    now = cum_perfect[n - 2];
    now += lazy[n - 1];
    now += lazy[n] + d + d;
    ans = min(ans, now);
  }
  ans += d * (n - 1LL);
  printf("%lld\n", ans);
  return 0;
}
