#include <bits/stdc++.h>
using namespace std;
const double EPS = 1e-9;
vector<vector<long long> > dp;
vector<long long> a;
long long n, r1, r2, r3, d;
long long sol(long long i, long long h) {
  if (dp[i][h] != LLONG_MAX) return dp[i][h];
  if (h == 0) {
    dp[i][h] = min(a[i] * r1 + r3 + d + sol(i - 1, 0), dp[i][h]);
    dp[i][h] = min((a[i] + 1) * r1 + r3 + 3 * d + sol(i - 1, 1), dp[i][h]);
    dp[i][h] = min((a[i] + 3) * r1 + 3 * d + sol(i - 1, 1), dp[i][h]);
    dp[i][h] = min(2 * r1 + r2 + 3 * d + sol(i - 1, 1), dp[i][h]);
    if (i == n - 1) {
      dp[i][h] = min((a[i] + 1) * r1 + r3 + 2 * d + sol(i - 1, 1), dp[i][h]);
    }
  } else {
    dp[i][h] = min(min(r2, r1 * (a[i] + 1)) + d + sol(i - 1, 0), dp[i][h]);
    dp[i][h] = min(r1 + r2 + 3 * d + sol(i - 1, 1), dp[i][h]);
    dp[i][h] = min((a[i] + 2) * r1 + 3 * d + sol(i - 1, 1), dp[i][h]);
  }
  return dp[i][h];
}
int main() {
  cin.sync_with_stdio(false);
  cin >> n >> r1 >> r2 >> r3 >> d;
  a.resize(n);
  for (auto i = (0); i < (n); ++i) cin >> a[i];
  dp = vector<vector<long long> >(n, vector<long long>(2, LLONG_MAX));
  dp[0][0] = r1 * a[0] + r3;
  dp[0][1] = min(r2, r1 * (a[0] + 1));
  cout << sol(n - 1, 0) << '\n';
}
