#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long t, n, i, j, k, m, q;
  string s;
  t = 1LL;
  long long r1, r2, r3, d;
  while (t--) {
    cin >> n;
    long long d;
    m = n;
    cin >> r1 >> r2 >> r3 >> d;
    vector<long long> v(n + 1LL);
    for (i = 1LL; i <= n; i++) cin >> v[i];
    vector<long long> kill1(n + 1, 0LL);
    vector<long long> kill2(n + 1, 0LL);
    for (i = 1LL; i <= n; i++) {
      kill1[i] = v[i] * r1 + r3 + d;
      kill2[i] = min(v[i] * r1 + 2LL * r1, r1 + r2) + 2LL * d;
    }
    vector<long long> dp(n + 1LL);
    dp[0LL] = 0LL;
    dp[1LL] = kill1[1LL];
    for (i = 2LL; i <= n; i++) {
      dp[i] = dp[i - 1LL] + kill1[i];
      dp[i] = min(dp[i], dp[i - 2LL] + kill2[i - 1LL] + kill2[i]);
    }
    dp[n] = min(dp[n], dp[n - 2LL] + kill2[n - 1LL] + kill1[n]);
    long long zero = 0LL;
    long long sum2 = accumulate(kill2.begin() + 1LL, kill2.end(), zero);
    cout << min(dp[n] - d, sum2) << endl;
  }
}
