#include <bits/stdc++.h>
using namespace std;
const int N = 1000010;
long long n, r[3], d;
long long a[N], dp[N];
long long go(int idx) {
  if (idx == n) {
    return -d;
  }
  long long &ret = dp[idx];
  if (ret != -1) return ret;
  ret = 1e18;
  long long RG = min(r[1] + r[0], r[0] * a[idx] + r[0] + r[0]);
  ret = min(ret, go(idx + 1) + d + a[idx] * r[0] + r[2]);
  ret = min(ret, go(idx + 1) + d * 3LL + RG);
  if (idx < n - 1) {
    ret = min(ret, go(idx + 2) + 4 * d +
                       min(r[1] + r[0], r[0] * a[idx + 1] + 2 * r[0]) + RG);
  }
  if (idx + 2 == n) {
    ret = min(ret, go(idx + 2) + 3 * d + a[idx + 1] * r[0] + r[2] + RG);
  }
  return ret;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n >> r[0] >> r[1] >> r[2] >> d;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  memset(dp, -1, sizeof dp);
  cout << go(0) << endl;
  return 0;
}
