#include <bits/stdc++.h>
using namespace std;
const int iinf = 0x3f3f3f3f;
const long long linf = 0x3f3f3f3f3f3f3f3f;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0), cout.tie(0);
  long long n, r1, r2, r3, d, ans = linf;
  cin >> n >> r1 >> r2 >> r3 >> d;
  vector<long long> a(n), pa(n), st(n);
  for (int i = (0), I = (n); i < I; i++)
    cin >> a[i], pa[i] = r1 * a[i] + r3,
                 st[i] = min(r2, r1 * (a[i] + 1)) + min(min(r1, r2), r3);
  vector<long long> f(n + 1, linf), g(n + 1);
  f[0] = d * (n - 1);
  for (int i = (0), I = (n); i < I; i++) {
    f[i + 1] = min(f[i + 1], f[i] + pa[i]);
    f[i + 1] = min(f[i + 1], f[i] + st[i] + d * 2);
    if (i + 1 < n) f[i + 2] = min(f[i + 2], f[i] + st[i] + st[i + 1] + d * 2);
  }
  ans = min(ans, f[n]);
  for (int i = (n - 2), I = (-1); i > I; i--)
    g[i] = g[i + 1] + min(pa[i], st[i]);
  for (int i = (0), I = (n - 1); i < I; i++) {
    ans = min(ans, f[i] + g[i] + d * (n - 1 - i) + pa[n - 1]);
    ans = min(ans, f[i] + g[i] + d * (n - 1 - i) + d * 2 + st[n - 1]);
  }
  cout << ans << '\n';
  return 0;
}
