#include <bits/stdc++.h>
using namespace std;
const int maxn = 1000005;
const long long inf = 1e18 + 5;
int n;
long long r1, r2, r3, d;
long long niz[maxn];
long long dp[maxn][2];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  cin >> n >> r1 >> r2 >> r3 >> d;
  for (int i = 1; i <= n; i++) cin >> niz[i];
  for (int i = 1; i <= n; i++) dp[i][0] = dp[i][1] = inf;
  dp[1][0] = niz[1] * r1 + r3;
  dp[1][1] = min(r2, r1 * (niz[1] + (long long)1));
  for (int i = 2; i <= n; i++) {
    dp[i][0] = min(dp[i][0], dp[i - 1][0] + d + r1 * niz[i] + r3);
    dp[i][1] =
        min(dp[i][1], dp[i - 1][0] + d + min(r2, r1 * (niz[i] + (long long)1)));
    dp[i][0] = min(dp[i][0], dp[i - 1][1] + d + r1 * niz[i] + r3 + d + r1 + d);
    dp[i][0] =
        min(dp[i][0], dp[i - 1][1] + d + r1 * niz[i] + r1 + d + r1 + d + r1);
    dp[i][0] = min(dp[i][0], dp[i - 1][1] + d + r2 + d + r1 + d + r1);
    dp[i][1] = min(
        dp[i][1], dp[i - 1][1] + d + r1 * (niz[i] + (long long)1) + d + r1 + d);
    dp[i][1] = min(dp[i][1], dp[i - 1][1] + d + r2 + d + r1 + d);
    if (i == n)
      dp[i][0] = min(dp[i][0], dp[i - 1][1] + d + r1 * niz[i] + r3 + d + r1);
  }
  cout << dp[n][0] << endl;
  return 0;
}
