#include <bits/stdc++.h>
using namespace std;
const int maxn = 1000003;
long long n, r1, r2, r3, d;
long long a[maxn], dp[maxn][2];
int main() {
  scanf("%lld%lld%lld%lld%lld", &n, &r1, &r2, &r3, &d);
  for (int i = 1; i <= n; ++i) scanf("%lld", &a[i]);
  dp[1][0] = r1 * a[1] + r3;
  dp[1][1] = min(r1 * (a[1] + 1), r2);
  for (int i = 2; i <= n; ++i) {
    dp[i][1] = min(dp[i - 1][0] + min(r1 * (a[i] + 1), r2),
                   dp[i - 1][1] + 2 * d + r1 + min(r1 * (a[i] + 1), r2)) +
               d;
    dp[i][0] = min(dp[i - 1][0] + r1 * a[i] + r3,
                   dp[i - 1][1] + 2 * d + r1 +
                       min(r1 * (a[i] + 2), min(r2 + r1, r1 * a[i] + r3))) +
               d;
  }
  printf("%lld\n", min(dp[n][0], dp[n - 1][1] + 2 * d + r1 +
                                     min(r1 * (a[n] + 2) + d,
                                         min(r2 + r1 + d, r1 * a[n] + r3))));
  return 0;
}
