#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e6 + 5;
long long n, r[4], d, a[maxn];
long long dp[maxn][2];
inline long long min(const long long &a, const long long &b,
                     const long long &c) {
  long long t = min(a, b);
  return min(t, c);
}
int main() {
  scanf("%lld%lld%lld%lld%lld", &n, r, r + 1, r + 2, &d);
  for (int i = 1; i <= n; i++) scanf("%lld", a + i);
  dp[1][0] = a[1] * min(r[0], r[2]) + r[2];
  dp[1][1] = min(r[1], a[1] * min(r[0], r[2]) + r[0]);
  for (int i = 2; i <= n; i++) {
    dp[i][0] = dp[i - 1][0] + a[i] * min(r[0], r[2]) + r[2] + d;
    dp[i][1] = dp[i - 1][0] + min(r[1], (a[i] + 1) * r[0]) + d;
    long long tmp = dp[i - 1][1] + min(r[0], r[1], r[2]) + d;
    if (i < n)
      dp[i][0] = min(dp[i][0], a[i] * min(r[0], r[2]) + r[2] + d + tmp + d);
    else
      dp[i][0] = min(dp[i][0], a[i] * min(r[0], r[2]) + r[2] + d + tmp);
    dp[i][0] = min(dp[i][0], min(r[1], (a[i] + 1) * r[0]) + d + tmp + d + r[0]);
  }
  printf("%lld\n", min(dp[n][0], dp[n][1] + d * 2 + min(r[0], r[1], r[2])));
  return 0;
}
