#include <bits/stdc++.h>
using namespace std;
void upd(long long &a, long long b) { a = (a < b) ? a : b; }
int a[1000006];
long long f[1000006][2];
int main() {
  int n;
  cin >> n;
  int r1, r2, r3, d;
  cin >> r1 >> r2 >> r3 >> d;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  for (int i = 2; i <= n; i++) {
    f[i][0] = f[i][1] = 1e18;
  }
  f[1][0] = 1ll * r1 * a[1] + r3;
  f[1][1] = min(0ll + r2, 1ll * r1 * a[1] + r1);
  for (int i = 1; i < n; i++) {
    upd(f[i + 1][0], f[i][0] + d + 1ll * r1 * a[i + 1] + r3);
    upd(f[i + 1][1], f[i][0] + d + min(0ll + r2, 1ll * r1 * a[i + 1] + r1));
    upd(f[i + 1][0], f[i][1] + d + 1ll * r1 * a[i + 1] + r3 + 2 * d + r1);
    upd(f[i + 1][0], f[i][1] + d + 1ll * r1 * a[i + 1] + r1 + d + r1 + d + r1);
    upd(f[i + 1][0], f[i][1] + d + r2 + d + r1 + d + r1);
    upd(f[i + 1][1], f[i][1] + d + r2 + d + r1 + d);
    upd(f[i + 1][1], f[i][1] + d + 1ll * r1 * a[i + 1] + r1 + d + r1 + d);
    if (i == n - 1) {
      upd(f[i + 1][0], f[i][1] + d + 1ll * r1 * a[i + 1] + r3 + d + r1);
    }
  }
  cout << f[n][0] << endl;
  return 0;
}
