#include <bits/stdc++.h>
using namespace std;
const long long N = (long long)1e6 + 7;
const long long INF = (long long)1e18;
long long n;
long long c1;
long long c2;
long long c3;
long long d;
long long a[N];
long long dp[N][2];
long long full(long long i) { return 1LL * a[i] * c1 + c3; }
long long part(long long i) { return min(1LL * (a[i] + 1) * c1, 1LL * c2); }
void upd(long long i, long long state, long long val) {
  dp[i][state] = min(dp[i][state], val);
}
signed main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> c1 >> c2 >> c3 >> d;
  for (long long i = 1; i <= n; i++) {
    cin >> a[i];
    dp[i][0] = dp[i][1] = INF;
  }
  dp[1][0] = full(1);
  dp[1][1] = part(1);
  for (long long i = 1; i < n; i++) {
    upd(i + 1, 0, dp[i][0] + d + full(i + 1));
    upd(i + 1, 1, dp[i][0] + d + part(i + 1));
    upd(i + 1, 0, dp[i][1] + 3 * d + c1 + full(i + 1));
    upd(i + 1, 0, dp[i][1] + 3 * d + 2 * c1 + part(i + 1));
    upd(i + 1, 1, dp[i][1] + 3 * d + c1 + part(i + 1));
    if (i == n - 1) {
      upd(n, 0, dp[i][1] + 2 * d + full(i + 1) + c1);
    }
  }
  cout << dp[n][0] << "\n";
}
