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