#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using PII = pair<int, int>;
using VI = vector<int>;
const int N = 1e6 + 10;
const ll INF = 1e18;
int a[N];
ll best[N][2];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  ll r1, r2, r3, d;
  cin >> r1 >> r2 >> r3 >> d;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    best[i][0] = best[i][1] = INF;
  }
  best[1][0] = a[1] * r1 + r3;
  best[1][1] = min(r2, (a[1] + 1) * r1);
  for (int i = 1; i < n; i++) {
    best[i + 1][0] = min(best[i + 1][0], best[i][0] + d + a[i + 1] * r1 + r3);
    best[i + 1][1] =
        min(best[i + 1][1], best[i][0] + d + min(r2, (a[i + 1] + 1) * r1));
    best[i + 1][0] =
        min(best[i + 1][0],
            best[i][1] + d +
                min({r2 + r1, (a[i + 1] + 2) * r1, a[i + 1] * r1 + r3}) + d +
                r1 + d);
    best[i + 1][1] =
        min(best[i + 1][1],
            best[i][1] + d + min(r2, (a[i + 1] + 1) * r1) + d + r1 + d);
  }
  cout << min(best[n][0], best[n - 1][1] + d + a[n] * r1 + r3 + d + r1) << endl;
  return 0;
}
