#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-10, pi = 3.1415926535898;
const int mod = 1e9 + 7, maxn = 1e6 + 10;
int T, n, m, k, x, y;
long long q[maxn], dp[maxn], a, b, c, d;
int main(int argc, char const *argv[]) {
  T = 1;
  for (int _ = 1; _ <= T; ++_) {
    long long ans = 0;
    scanf("%d %lld %lld %lld %lld", &n, &a, &b, &c, &d);
    for (int i = 1; i <= n; ++i) {
      scanf("%lld", &q[i]);
      dp[i] = 1LL * mod * mod;
    }
    dp[0] = -d;
    dp[1] = a * q[1] + c;
    for (int i = 2; i <= n; ++i) {
      dp[i] = min(dp[i], dp[i - 1] + d + a * q[i] + c);
      dp[i] = min(dp[i], dp[i - 1] + 3 * d + b + a);
      dp[i] = min(dp[i], dp[i - 1] + 3 * d + a * q[i] + a * 2);
      dp[i] = min(dp[i], dp[i - 2] + 4 * d + 2 * b + 2 * a);
      dp[i] = min(dp[i], dp[i - 2] + 4 * d + a * (q[i] + 2) + a + b);
      dp[i] = min(dp[i], dp[i - 2] + 4 * d + a * (q[i - 1] + 2) + a + b);
      dp[i] = min(dp[i], dp[i - 2] + 4 * d + a * (q[i - 1] + q[i] + 4));
    }
    ans = dp[n];
    ans = min(ans, dp[n - 2] + 3 * d + a * q[n] + c + b + a);
    ans = min(ans, dp[n - 2] + 3 * d + a * q[n] + c + a * (q[n - 1] + 2));
    printf("%lld\n", ans);
  }
  return 0;
}
