#include <bits/stdc++.h>
using namespace std;
int num[1000005];
long long dp[1000005][3];
int main() {
  int n;
  long long r1, r2, r3, d;
  scanf("%d %lld %lld %lld %lld", &n, &r1, &r2, &r3, &d);
  for (int i = (1); i <= (n); i++) {
    scanf("%d", &num[i]);
  }
  dp[0][0] = 0;
  dp[0][1] = dp[0][2] = 1000000000000000000;
  long long ans;
  for (int i = (1); i <= (n); i++) {
    long long plan1 = min(r1, r3) * num[i] + r3;
    long long plan2 = min(r1 * (num[i] + 2), r2 + min(r1, min(r2, r3)));
    if (i == n) {
      ans = min(min(dp[n - 1][0], dp[n - 1][1]) + min(plan1, plan2 + d * 2),
                dp[n - 1][2] + min(plan1, plan2));
    } else {
      dp[i][0] =
          min(dp[i - 1][0] + plan1, dp[i - 1][2] + min(plan1, plan2)) + d;
      dp[i][2] = min(dp[i - 1][0], dp[i - 1][2]) + plan2 + d * 3;
      dp[i][1] = min(min(dp[i - 1][0], dp[i - 1][2]) + plan2,
                     dp[i - 1][1] + min(plan1, plan2)) +
                 d * 2;
    }
  }
  printf("%lld\n", ans);
  return 0;
}
