#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e6 + 60;
long long saveori[maxn];
long long ak[maxn][2];
long long dp[maxn];
void solve() {
  long long n, r1, r2, r3, d;
  scanf("%lld %lld %lld %lld %lld", &n, &r1, &r2, &r3, &d);
  for (int i = 1; i <= n; i++) {
    scanf("%lld", &saveori[i]);
  }
  ak[1][0] = saveori[1] * r1 + r3;
  ak[1][1] = (r2 < saveori[1] * r1 + r1 ? r2 : saveori[1] * r1 + r1);
  for (int i = 2; i <= n; i++) {
    ak[i][1] = (r2 < saveori[i] * r1 + r1 ? r2 : saveori[i] * r1 + r1) +
               ak[i - 1][0] + d;
    ak[i][0] = ak[i - 1][0] + saveori[i] * r1 + r3 + d;
    ak[i][0] = (ak[i][0] < ak[i - 1][0] + saveori[i] * r1 + r1 + d + d + r1 + d
                    ? ak[i][0]
                    : ak[i - 1][0] + saveori[i] * r1 + r1 + d + d + r1 + d);
    ak[i][0] =
        (ak[i][0] < ak[i - 1][1] + saveori[i] * r1 + r1 + r1 + d + d + r1 + d
             ? ak[i][0]
             : ak[i - 1][1] + saveori[i] * r1 + r1 + r1 + d + d + r1 + d);
    ak[i][0] = (ak[i][0] < ak[i - 1][1] + d + r2 + d + r1 + d + r1
                    ? ak[i][0]
                    : ak[i - 1][1] + d + r2 + d + r1 + d + r1);
    ak[i][0] = (ak[i][0] < ak[i - 1][0] + d + r2 + d + d + r1
                    ? ak[i][0]
                    : ak[i - 1][0] + d + r2 + d + d + r1);
  }
  dp[n] = saveori[n] * r1 + r3;
  dp[n] = (dp[n] < (r2 < saveori[n] * r1 + r1 ? r2 : saveori[n] * r1 + r1) + d +
                       d + r1
               ? dp[n]
               : (r2 < saveori[n] * r1 + r1 ? r2 : saveori[n] * r1 + r1) + d +
                     d + r1);
  for (int i = n - 1; i >= 1; i--) {
    dp[i] = r2 + r1 + d * 2;
    dp[i] =
        (dp[i] < saveori[i] * r1 + r3 + d * 2 ? dp[i]
                                              : saveori[i] * r1 + r3 + d * 2);
    dp[i] += dp[i + 1];
  }
  long long ans = 1e16;
  for (int i = 0; i <= n; i++) {
    ans = (ak[i][0] + dp[i + 1] + d * (i != n && i != 0) < ans
               ? ak[i][0] + dp[i + 1] + d * (i != n && i != 0)
               : ans);
  }
  printf("%lld\n", ans);
}
int main() { solve(); }
