#include <bits/stdc++.h>
using namespace std;
template <class T>
ostream& operator<<(ostream& out, vector<T>& v) {
  for (auto it = v.begin(); it != v.end(); ++it) {
    if (it == v.begin())
      out << *it;
    else
      out << " " << *it;
  }
  out << "\n";
  return out;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long cleared = 0;
  long long clearednt = 0;
  long long n;
  cin >> n;
  long long r1, r2, r3, d;
  cin >> r1 >> r2 >> r3 >> d;
  for (int i = 0; i < n; i++) {
    long long a;
    cin >> a;
    auto t1 = a * r1 + r3;
    auto t2 = min((a + 2) * r1, r2 + r1);
    auto c1 = min(cleared + t1, clearednt + min(t2, t1) + 2 * d);
    auto c2 = cleared + t2;
    if (i == n - 1) {
      c1 = min(c1, clearednt + t1 + d);
    }
    cleared = c1;
    clearednt = c2;
  }
  cout << cleared + d * (n - 1) << "\n";
}
