#include <bits/stdc++.h>
#pragma GCC optimize(2)
using namespace std;
const long long mod = 998244353;
const double eps = 1e-8;
const double pi = acos(-1.0);
long long n, d, r[4], a[1005000], dp[1005000][2], k[1005000][2], sum[1005000];
int main() {
  cin >> n >> r[1] >> r[2] >> r[3] >> d;
  for (int i = 1; i <= n; i++) cin >> a[i];
  dp[1][1] = min((a[1] + 2) * r[1], r[1] + r[2]);
  dp[1][0] = a[1] * r[1] + r[3];
  for (int i = 1; i <= n; i++) {
    k[i][1] = min((a[i] + 2) * r[1], r[1] + r[2]),
    k[i][0] = min(a[i] * r[1] + r[3], k[i][1] + 2 * d);
    if (i > 1) {
      dp[i][0] = k[i][1] + dp[i - 1][1] + 3 * d;
      dp[i][0] = min(dp[i][0], k[i][0] + dp[i - 1][0] + d);
      dp[i][1] = k[i][1] + dp[i - 1][0] + d;
    }
  }
  long long ans = min(dp[n][0], dp[n][1] + 2 * d);
  sum[n] = k[n][0] + d;
  for (int i = n - 1; i > 0; i--) {
    ans = min(ans, dp[i][0] + sum[i + 1]);
    sum[i] = sum[i + 1] + k[i][1] + 2 * d;
  }
  ans = min(ans, sum[1] - d);
  cout << ans;
  return 0;
}
