#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 6e1;
long long r1, r2, r3, d;
vector<long long> a;
long long Memo[N][2];
int n;
long long Calc(int i, bool CameBefore) {
  if (i == n) return -1ll * d;
  long long &Re = Memo[i][CameBefore];
  if (Re + 1ll) return Re;
  Re = 0x7fffffffffffffff;
  if (CameBefore) {
    if (i == n - 1)
      Re = min(Re, Calc(i + 1, 0) + 1ll * r1 * a[i] + r3);
    else
      Re = min(Re, Calc(i + 1, 0) + 1ll * r1 * a[i] + r3 + d);
    Re = min(Re, Calc(i + 1, 0) + 1ll * r2 + r1 + d);
    Re = min(Re, Calc(i + 1, 0) + 1ll * r1 * a[i] + 2ll * r1 + d);
  } else {
    Re = min(Re, Calc(i + 1, 0) + 1ll * r1 * a[i] + r3 + d);
    Re = min(Re, Calc(i + 1, 1) + 1ll * r2 + r1 + 3 * d);
    Re = min(Re, Calc(i + 1, 1) + 1ll * r1 * a[i] + 2ll * r1 + 3ll * d);
  }
  return Re;
}
int main() {
  scanf("%d%lld%lld%lld%lld", &n, &r1, &r2, &r3, &d);
  a.resize(n);
  for (auto &i : a) scanf("%lld", &i);
  memset(Memo, -1, sizeof Memo);
  long long Ans = Calc(0, false);
  printf("%lld", Ans);
  return 0;
}
