#include <bits/stdc++.h>
using namespace std;
long long n, r1, r2, r3, d, v[1000006], dp[1000006][3];
long long f(int pos, int mode) {
  if (pos == n - 1) {
    if (mode == 1) {
      return min(r3 + v[pos] * min(r3, r1) + d + min({r2, r1, r3}),
                 min(r1 * (v[pos] + 1), r2) + 2 * d + 2 * min({r1, r2, r3}));
    } else {
      return min(min(r1 * (v[pos] + 1), r2) + 2 * d + min({r1, r2, r3}),
                 r3 + v[pos] * min(r3, r1));
    }
  }
  if (dp[pos][mode] != -1) return dp[pos][mode];
  long long res = LLONG_MAX;
  if (mode == 0) {
    res = min(res, min(r1 * (v[pos] + 1), r2) + d + f(pos + 1, 1));
    res = min(res, min(r1 * (v[pos] + 1), r2) + 2 * d + min({r1, r2, r3}) +
                       f(pos + 1, 2));
    res = min(res, r3 + v[pos] * min(r3, r1) + d + f(pos + 1, 0));
  } else if (mode == 1) {
    res = min(res, min(r1 * (v[pos] + 1), r2) + 3 * d + 2 * min({r1, r2, r3}) +
                       f(pos + 1, 0));
    res = min(res, r3 + v[pos] * min(r3, r1) + 3 * d + min({r1, r2, r3}) +
                       f(pos + 1, 0));
  } else {
    res = min(res, min(r1 * (v[pos] + 1), r2) + 2 * d + min({r1, r2, r3}) +
                       f(pos + 1, 2));
    res = min(res, r3 + v[pos] * min(r3, r1) + 2 * d + f(pos + 1, 2));
  }
  return dp[pos][mode] = res;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  memset(dp, -1, sizeof(dp));
  cin >> n >> r1 >> r2 >> r3 >> d;
  for (int i = 0; i < n; i++) {
    cin >> v[i];
  }
  cout << f(0, 0) << "\n";
  return 0;
}
