#include <bits/stdc++.h>
using namespace std;
int INF = 1e9 + 7;
long long LINF = 1e18;
int MOD = 998244353;
ostream& operator<<(ostream& out, vector<int>& v) {
  for (int num : v) out << num << ' ';
  return out;
}
ostream& operator<<(ostream& out, vector<long long>& v) {
  for (long long num : v) out << num << ' ';
  return out;
}
istream& operator>>(istream& in, vector<int>& v) {
  for (int i = 0; i < v.size(); i++) in >> v[i];
  return in;
}
istream& operator>>(istream& in, vector<long long>& v) {
  for (int i = 0; i < v.size(); i++) in >> v[i];
  return in;
}
int eu(int a, int b) {
  if (a == 0)
    return b;
  else
    return eu(b % a, a);
}
long long binpow(long long a, long long pow) {
  long long cur = a;
  long long ans = 1;
  for (; pow > 0; pow >>= 1) {
    if (pow & 1) ans *= cur;
    cur *= cur;
  }
  return ans;
}
int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  long long r1, r2, r3, d;
  cin >> r1 >> r2 >> r3 >> d;
  vector<long long> a(n);
  cin >> a;
  vector<vector<long long> > dp(2, vector<long long>(n + 1, LINF));
  dp[0][0] = 0;
  for (int i = 1; i <= n; i++) {
    dp[0][i] =
        min(dp[0][i], dp[0][i - 1] + (i > 1 ? d : 0) + r1 * a[i - 1] + r3);
    dp[0][i] = min(dp[0][i], dp[1][i - 1] + d + r1 * a[i - 1] + r3 + d + r1 +
                                 (i < n ? d : 0));
    dp[1][i] = min(dp[1][i], dp[0][i - 1] + (i > 1 ? d : 0) +
                                 min(r2, r1 * (a[i - 1] + 1)));
    dp[1][i] = min(
        dp[1][i], dp[1][i - 1] + d + min(r2, r1 * (a[i - 1] + 1)) + d + r1 + d);
    dp[0][i] = min(dp[0][i], dp[1][i - 1] + d + min(r2, r1 * (a[i - 1] + 1)) +
                                 d + r1 + d + r1);
  }
  cout << dp[0][n];
}
