#include <bits/stdc++.h>
using namespace std;
const int SZ = 1e6 + 5;
const long long INF = 1e18;
int n, ar[SZ];
long long dp[SZ][3], a, b, c, d;
int main() {
  ios ::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> a >> b >> c >> d;
  for (int i = 1; i <= n; i++) {
    cin >> ar[i];
  }
  dp[0][1] = dp[0][2] = INF;
  dp[0][0] = -d;
  for (int i = 1; i <= n; i++) {
    dp[i][0] = dp[i][1] = dp[i][2] = INF;
    long long r = min({ar[i] * a + c, (ar[i] + 2) * a + 2 * d, a + b + 2 * d}) +
                  d,
              r2 = min({(ar[i] + 2) * a, a + b, ar[i] * a + c}) + d;
    if (dp[i - 1][0] < INF) dp[i][0] = min(dp[i][0], dp[i - 1][0] + r);
    if (dp[i - 1][2] < INF)
      dp[i][0] = min(dp[i][0], dp[i - 1][2] + r2 + 2 * d * i);
    if (i == n && dp[i - 1][1] < INF) {
      dp[i][0] = min(dp[i][0], dp[i - 1][1] + r + d * i);
    }
    if (dp[i - 1][0] < INF) dp[i][1] = min(dp[i][1], dp[i - 1][0] + r2 - d * i);
    if (dp[i - 1][1] < INF) dp[i][1] = min(dp[i][1], dp[i - 1][1] + r2);
    if (dp[i - 1][0] < INF)
      dp[i][2] = min(dp[i][2], dp[i - 1][0] + r2 - 2 * d * i);
    if (dp[i - 1][2] < INF) dp[i][2] = min(dp[i][2], dp[i - 1][2] + r2);
  }
  cout << dp[n][0] << "\n";
  return 0;
}
