#include <bits/stdc++.h>
using namespace std;
const long long int INF = 1e18;
const long long int MOD = 1e9 + 7;
const int N = 1e6 + 6;
long long int dp[N][2];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long int n, r1, r2, r3, d;
  cin >> n >> r1 >> r2 >> r3 >> d;
  vector<long long int> vec(n + 1);
  for (int i = 1; i <= n; i++) cin >> vec[i];
  dp[0][1] = INF;
  for (int i = 1; i <= n; i++) {
    dp[i][0] = min({dp[i - 1][0] + vec[i] * r1 + r3,
                    dp[i - 1][0] + min((vec[i] + 2) * r1, r2 + r1) + 2 * d,
                    dp[i - 1][1] + d * 2 +
                        min({vec[i] * r1 + r3, r2 + r1, (vec[i] + 2) * r1}),
                    (i == n ? dp[i - 1][1] + d + vec[i] * r1 + r3 : INF)});
    dp[i][1] = dp[i - 1][0] + min(r2 + r1, (vec[i] + 2) * r1);
  }
  cout << dp[n][0] + d * (n - 1) << '\n';
  return 0;
}
