#include <bits/stdc++.h>
using namespace std;
long long arr[1000005], sum[1000005], dp[1000005];
int main() {
  long long i, j, k, a, b, c, n, t, d, r1, r2, r3, ret, ans;
  scanf("%lld%lld%lld%lld%lld", &n, &r1, &r2, &r3, &d);
  for (i = 1; i <= n; i++) scanf("%lld", &arr[i]);
  sum[n] = min(r1 * arr[n] + min(r3, 2 * d + r1 * 2), r2 + 2 * d + r1);
  for (i = n - 1; i >= 1; i--) {
    sum[i] = sum[i + 1] + min(arr[i] * r1 + min(r3, 2 * r1), r2 + r1);
  }
  ans = -1;
  for (i = 1; i <= n; i++) {
    if (ans == -1 || ans > dp[i - 1] + sum[i] + d + 2 * d * (n - i))
      ans = dp[i - 1] + sum[i] + d + 2 * d * (n - i);
    dp[i] = dp[i - 1] + d +
            min(r1 * arr[i] + min(2 * (r1 + d), r3), r2 + d * 2 + r1);
    if (i - 1)
      dp[i] = min(dp[i], dp[i - 2] + d + min(r1 * (arr[i - 1] + 2), r2 + r1) +
                             min(r1 * (arr[i] + 2), r2 + r1) + 3 * d);
  }
  printf("%lld\n", min(ans, dp[n]) - d);
}
