#include <bits/stdc++.h>
using namespace std;
const long double EPS = 1e-9;
const long long MOD = 1e9 + 7;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout << fixed << setprecision(20);
  mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
  int n;
  cin >> n;
  long long r1, r2, r3;
  cin >> r1 >> r2 >> r3;
  long long d;
  cin >> d;
  vector<long long> a(n);
  for (int i = 0; i < n; i++) cin >> a[i];
  vector<vector<long long>> dp(n, vector<long long>(2, 0));
  for (int i = 0; i < n; i++) {
    long long prev_0 = i == 0 ? 0 : dp[i - 1][0];
    long long prev_1 = i == 0 ? 0 : dp[i - 1][1];
    long long cur_1_hp = min((a[i] + 1) * r1, r2);
    dp[i][0] = min(prev_0 + a[i] * r1 + r3,
                   min(prev_0, prev_1 + r1) + 2 * d + cur_1_hp + r1);
    if (i == n - 1) dp[i][0] = min(dp[i][0], prev_1 + r1 + d + a[i] * r1 + r3);
    dp[i][1] =
        min(prev_0 + cur_1_hp, min(prev_0, prev_1 + r1) + 2 * d + cur_1_hp);
  }
  long long res = (n - 1) * d + dp[n - 1][0];
  cout << res << '\n';
  return 0;
}
