#include <bits/stdc++.h>
using namespace std;
const int nax = 1e6 + 5;
long long int a[nax];
long long int r1, r2, r3;
long long int d;
int n;
long long int dp[nax];
long long int cost[nax];
long long int suf[nax];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  cin >> r1 >> r2 >> r3;
  cin >> d;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  for (int i = 1; i <= n; i++) {
    long long int basic = a[i] * r1 + r3;
    long long int fast = min(a[i] * r1 + r1, r2) + r1;
    cost[i] = min(basic, fast);
  }
  for (int i = n - 1; i >= 1; i--) suf[i] = suf[i + 1] + cost[i];
  for (int i = n; i >= 1; i--) {
    long long int basic = a[i] * r1 + r3;
    long long int fast = min(a[i] * r1 + r1, r2) + r1;
    if (i == n) {
      dp[i] = min(basic, fast + d * 2);
      continue;
    }
    long long int basic2 = a[i + 1] * r1 + r3;
    long long int fast2 = min(a[i + 1] * r1 + r1, r2) + r1;
    long long int p = dp[i + 1] + basic + d;
    dp[i] = p;
    long long int p2 =
        min(basic, fast) + d * 4 + min(basic2, fast2) + dp[i + 2];
    if (i == n - 1) p2 -= d;
    dp[i] = min(p, p2);
    long long int kk = 0;
    long long int basic_gg = a[n] * r1 + r3;
    long long int fast_gg = min(a[n] * r1 + r1, r2) + r1;
    kk = min(basic_gg, fast_gg + d * 2);
    dp[i] = min(dp[i], (n - i) * 2 * d + suf[i] + kk);
  }
  cout << dp[1];
  return 0;
}
