#include <bits/stdc++.h>
using namespace std;
const long long M = 1e6 + 10, M2 = 1e6 + 10, oo = 1e9 + 7;
long long ara[M], le[M], ri[M], r1, r2, r3;
long long tkill(long long x) { return min(r1 * x + 2 * r1, r2 + r1); }
long long onkill(long long x) { return r1 * x + r3; }
void solve() {
  long long n, d;
  cin >> n >> r1 >> r2 >> r3 >> d;
  for (int i = 0; i < n; i++) {
    cin >> ara[i];
  }
  le[0] = -d;
  le[1] = min(tkill(ara[0]) + 2 * d, onkill(ara[0]));
  ri[n] = min(tkill(ara[n - 1]) + 2 * d, onkill(ara[n - 1]));
  for (int i = 2; i <= n; i++) {
    le[i] = min(le[i - 1] + onkill(ara[i - 1]) + d,
                le[i - 2] + tkill(ara[i - 2]) + 4 * d + tkill(ara[i - 1]));
  }
  ri[n + 1] = -d;
  for (int i = n - 1; i > 0; i--) {
    ri[i] = ri[i + 1] + tkill(ara[i - 1]) + 2 * d;
  }
  long long ans = LLONG_MAX;
  for (int i = 1; i <= n; i++) {
    ans = min(ans, le[i] + ri[i + 1] + d);
  }
  cout << ans << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  solve();
  return 0;
}
