#include <bits/stdc++.h>
using namespace std;
template <class c>
struct rge {
  c b, e;
};
template <class c>
rge<c> range(c i, c j) {
  return {i, j};
}
struct printer {
  ~printer() { cerr << endl; }
  template <class c>
  printer& operator,(c x) {
    cerr << boolalpha << x;
    return *this;
  }
  printer& operator,(string x) {
    cerr << x;
    return *this;
  }
  template <class c, class d>
  printer& operator,(pair<c, d> x) {
    return *this, "(", x.first, ", ", x.second, ")";
  }
  template <class... d, template <class...> class c>
  printer& operator,(c<d...> x) {
    return *this, range(begin(x), end(x));
  }
  template <class c>
  printer& operator,(rge<c> x) {
    *this, "[";
    for (auto it = x.b; it != x.e; ++it) *this, (it == x.b ? "" : ", "), *it;
    return *this, "]";
  }
};
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int my_rand(int l, int r) { return uniform_int_distribution<int>(l, r)(rng); }
const int N = 1e6 + 100;
long long a[N];
long long dp[N];
long long dp_half[N];
long long r1, r2, r3, tele;
long long full_kill(int idx) { return r1 * a[idx] + r3; }
long long half_kill(int idx) { return min(r1 * a[idx] + 2 * r1, r2 + r1); }
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  cin >> r1 >> r2 >> r3 >> tele;
  for (int i = 1; i <= n; i++) cin >> a[i];
  for (int i = n; i >= 1; i--) {
    if (i == n - 1) {
      dp_half[i] = 2 * tele + half_kill(i) + full_kill(i + 1);
      dp_half[i] = min(dp_half[i], half_kill(i) + half_kill(i + 1) + 4 * tele);
    }
    if (i < n - 1) {
      dp_half[i] = 2 * tele + half_kill(i) + dp_half[i + 1];
    }
    dp[i] = dp[i + 1] + full_kill(i) + (i == n ? 0 : tele);
    if (i <= n - 1) {
      dp[i] = min(dp[i], dp[i + 2] + half_kill(i) + half_kill(i + 1) +
                             (i == n - 1 ? 3 * tele : 4 * tele));
    }
    if (i != n) dp[i] = min(dp[i], dp_half[i]);
  }
  cout << dp[1] << endl;
}
