#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
const int maxn = 1000005;
long long dp[maxn][2];
void go() {
  long long n, r1, r2, r3, d;
  cin >> n >> r1 >> r2 >> r3 >> d;
  r1 = min(r1, r3);
  dp[0][1] = 1e18;
  for (int i = 1; i <= n; i++) {
    long long x;
    cin >> x;
    dp[i][0] =
        min(dp[i - 1][1] + min({r1 * x + r3, r1 * (x + 2), r2 + min(r1, r2)}),
            dp[i - 1][0] + r1 * x + r3) +
        d;
    dp[i][1] = dp[i - 1][0] + 2 * d + min({r2 + min(r1, r2), r1 * (x + 2)}) + d;
    if (i == 1) {
      dp[i][0] -= d;
      dp[i][1] -= d;
    }
    dp[i][0] = min(dp[i][0], dp[i][1]);
    if (i == n) {
      dp[n][0] = min(dp[n][0], dp[n - 1][1] + r1 * x + r3);
    }
  }
  cout << dp[n][0] << '\n';
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int c = 0;
  int t;
  if (!c) {
    t = 1;
  } else {
    cin >> t;
  }
  while (t--) {
    go();
  }
}
