#include <bits/stdc++.h>
using namespace std;
int main(void) {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  long long r1, r2, r3, d;
  cin >> n >> r1 >> r2 >> r3 >> d;
  vector<int> a(n);
  for (int i = 0; i < n; i++) cin >> a[i];
  vector<vector<long long>> dp(n, vector<long long>(2, LLONG_MAX));
  dp[0][0] = r1 * a[0] + r3;
  dp[0][1] = min(r1 * (a[0] + 2), r2 + r1);
  for (int i = 1; i < n; i++) {
    long long one = r1 * a[i] + r3;
    long long two = min(r1 * (a[i] + 2), r2 + r1);
    dp[i][0] = min(dp[i][0], dp[i - 1][0] + one);
    dp[i][0] = min(dp[i][0], dp[i - 1][1] + min(one, two) + 2 * d);
    if (i == n - 1) dp[i][0] = min(dp[i][0], dp[i - 1][1] + one + d);
    dp[i][1] = min(dp[i][1], dp[i - 1][0] + two);
  }
  printf("%lld\n", min(dp[n - 1][0], dp[n - 1][1] + 2 * d) + (n - 1) * d);
  return 0;
}
