#include <bits/stdc++.h>
using namespace std;
void func(void) {
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
}
void print(vector<long long> &v) {
  cout << v.size() << endl;
  for (int i = 0; i < v.size(); i++) {
    printf("%lld ", v[i]);
  }
  cout << "------------------------------------------------------\n";
  printf("\n");
}
void print(vector<pair<long long, long long> > &v) {
  cout << v.size() << endl;
  for (int i = 0; i < v.size(); i++) {
    printf("%lld %lld\n", v[i].first, v[i].second);
  }
  cout << "----------------------------------------------------------\n";
}
void print(double d) {
  cout << fixed << setprecision(10) << d << endl;
  cout << "--------------------------------------------------------\n";
}
void print(string s, double d) {
  cout << s << " ";
  cout << fixed << setprecision(10) << d << endl;
  cout << "-----------------------------------------------------------\n";
}
template <typename T>
void readToVector(vector<T> &v, long long n) {
  T x;
  for (int i = 0; i < n; i++) {
    cin >> x;
    v.push_back(x);
  }
}
const int N = 1e6 + 100;
vector<long long> v;
long long r1, r2, r3, d, n;
long long dp[N][3];
long long getAllPistolKilled(long long cnt) { return r1 * cnt + r1; }
long long getAllPistolKilledAndOneAWP(long long cnt) { return cnt * r1 + r3; }
long long getAllPistolKilledAndOneLazer(long long cnt) { return cnt * r1 + r2; }
long long getAllAWPAndOneLazer(long long cnt) { return cnt * r3 + r2; }
long long getAllAWP(long long cnt) { return r3 * cnt + r3; }
long long getAllLazer(long long cnt) { return r2; }
long long getMiniOne() { return min(r1, min(r2, r3)); }
long long calc(int i, int j) {
  if (i == n) {
    return -d;
  }
  long long &ret = dp[i][j];
  if (ret != -1) return ret;
  long long ans = 1e18;
  long long temp = ans;
  long long temp2 = ans;
  long long cnt = v[i];
  if (j == 0) {
    ans = min(ans, getAllPistolKilledAndOneAWP(cnt) + calc(i + 1, 0));
    ans = min(ans, getAllAWP(cnt) + calc(i + 1, 0));
    ans += d;
    temp2 = min(temp2, getAllPistolKilled(cnt) + calc(i + 1, 1));
    temp2 = min(temp2, getAllAWPAndOneLazer(cnt) + calc(i + 1, 1));
    temp2 = min(temp2, getAllPistolKilledAndOneLazer(cnt) + calc(i + 1, 1));
    temp2 = min(temp2, getAllLazer(cnt) + calc(i + 1, 1));
    temp2 += d;
    if (i == n - 1) {
      temp2 += d + d + getMiniOne();
    }
    ans = min(ans, temp2);
  }
  if (j == 1) {
    ans = min(ans, getAllPistolKilledAndOneAWP(cnt) + calc(i + 1, 0));
    ans = min(ans, getAllAWP(cnt) + calc(i + 1, 0));
    ans += d;
    ans += getMiniOne();
    ans += d;
    if (i != n - 1) ans += d;
    temp2 = min(temp2, getAllPistolKilled(cnt) + calc(i + 1, 0));
    temp2 = min(temp2, getAllAWPAndOneLazer(cnt) + calc(i + 1, 0));
    temp2 = min(temp2, getAllPistolKilledAndOneLazer(cnt) + calc(i + 1, 0));
    temp2 = min(temp2, getAllLazer(cnt) + calc(i + 1, 0));
    temp2 += d + d + getMiniOne() + getMiniOne();
    temp2 += d;
    ans = min(ans, temp2);
  }
  ans = min(ans, temp);
  return ret = ans;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  long long q, i, j = 0, temp, t, k, ans = 0, sum = 0, x, y, z, cnt = 0, m,
                  fg = 0, mx = 0, mx1 = 0, mn = 8000000000000000000,
                  mn1 = 8000000000000000000;
  cin >> n >> r1 >> r2 >> r3 >> d;
  memset((dp), -1, sizeof(dp));
  readToVector(v, n);
  ans = calc(0, 0);
  cout << ans << endl;
}
