#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, r1, r2, r3, d;
  cin >> n >> r1 >> r2 >> r3 >> d;
  vector<long long> a(n), oneshot(n), twoshot(n), dp(n);
  r1 = min(r1, r3);
  for (auto& e : a) cin >> e;
  for (int i = 0; i < n; i++) {
    oneshot[i] = a[i] * r1 + r3;
    twoshot[i] = min((a[i] + 1) * r1, r2) + r1;
  }
  dp[n - 1] = min(oneshot[n - 1], twoshot[n - 1] + d + d);
  for (int i = n - 2; i > -1; i--) {
    dp[i] = oneshot[i] + d + dp[i + 1];
    if (i < n - 2)
      dp[i] =
          min(dp[i], twoshot[i] + twoshot[i + 1] + d + d + d + d + dp[i + 2]);
    else {
      dp[i] = min(dp[i], twoshot[i] + oneshot[i + 1] + d + d);
      dp[i] = min(dp[i], twoshot[i] + twoshot[i + 1] + d + d + d);
    }
  }
  cout << dp[0] << endl;
  return 0;
}
