#include <bits/stdc++.h>
using namespace std;
long long dp[1000005][3];
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  long long n, r1, r2, r3, d;
  cin >> n >> r1 >> r2 >> r3 >> d;
  vector<long long> a(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  long long t0 = a[0] * r1 + r3;
  t0 = min(t0, (a[0] + 1) * r3);
  dp[0][1] = 1e18;
  dp[0][2] = min(r2, (a[0] + 1) * r1) + min({r1, r2, r3}) + 2 * d;
  dp[0][0] = min(dp[0][2], t0);
  for (int i = 1; i < n; i++) {
    long long t = a[i] * r1 + r3;
    t = min(t, (a[i] + 1) * r3);
    dp[i][0] = min(dp[i - 1][0], dp[i - 1][1]) +
               min(t, min(r2, (a[i] + 1) * r1) + d * 2 + min({r1, r2, r3}));
    dp[i][1] = dp[i - 1][2] + min(r2, (a[i] + 1) * r1) + min({r1, r2, r3});
    dp[i][2] = min(dp[i - 1][0], dp[i - 1][1]) + min(r2, (a[i] + 1) * r1) +
               min({r1, r2, r3}) + 2 * d;
  }
  dp[n - 1][1] =
      min(dp[n - 1][1],
          dp[n - 2][2] + min(a[n - 1] * r1 + r3, (a[n - 1] + 1) * r3) - d);
  long long ans = (n - 1) * d + min({dp[n - 1][0], dp[n - 1][1], dp[n - 1][2]});
  cout << ans;
  return 0;
}
