#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
long long binpow(long long a, long long b) {
  long long res = 1;
  while (b) {
    if (b & 1) res = (res * a) % MOD;
    a = (a * a) % MOD;
    b >>= 1;
  }
  return res;
}
long long modInv(long long a) { return binpow(a, MOD - 2); }
bool sortcol(const vector<long long>& v1, const vector<long long>& v2) {
  return v1[1] < v2[1];
}
template <class T>
bool ckmin(T& a, const T& b) {
  return b < a ? a = b, 1 : 0;
}
template <class T>
bool ckmax(T& a, const T& b) {
  return a < b ? a = b, 1 : 0;
}
int pct(int x) { return __builtin_popcount(x); }
int bits(int x) { return 31 - __builtin_clz(x); }
int cdiv(int a, int b) { return a / b + !(a < 0 || a % b == 0); }
int fstTrue(function<bool(int)> first, int lo, int hi) {
  hi++;
  assert(lo <= hi);
  while (lo < hi) {
    int mid = (lo + hi) / 2;
    first(mid) ? hi = mid : lo = mid + 1;
  }
  return lo;
}
mt19937 rng((uint32_t)chrono::steady_clock::now().time_since_epoch().count());
uniform_int_distribution<long long unsigned> distribution(0, 10);
const int mxN = 1e6 + 10;
int q = 1, n;
long long r1, r2, r3, d, arr[mxN], dp[mxN];
void solve() {
  cin >> n >> r1 >> r2 >> r3 >> d;
  for (int i = (0); i < (n); i++) cin >> arr[i];
  fill(dp + 1, dp + mxN, LLONG_MAX);
  for (int i = (0); i < (n); i++) {
    ckmin(dp[i + 1], dp[i] + d + r1 * arr[i] + r3);
    ckmin(dp[i + 2],
          dp[i] + 4 * d + min(r1 * (arr[i] + 1), r2) + r1 +
              min({r1 * (arr[i + 1] + 2), r1 * (arr[i + 1]) + r3, r2 + r1}));
  }
  cout << min({dp[n] - d,
               dp[n - 1] + 2 * d +
                   min({r1 * (arr[n - 1] + 2), 2 * r2, r2 + r1, r2 + r3}),
               dp[n - 2] + 2 * d + min(r1 * (arr[n - 2] + 1), r2) +
                   min({r1, r2, r3}) +
                   min(r1 * arr[n - 1] + r3, r3 * (arr[n - 1] + 1))})
       << "\n";
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  while (q--) {
    solve();
  }
}
