#include <bits/stdc++.h>
using namespace std;
void fast() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
}
int main() {
  fast();
  long long n;
  cin >> n;
  long long r[4];
  for (int i = 1; i <= 3; ++i) {
    cin >> r[i];
  }
  long long d;
  cin >> d;
  long long a[n + 1];
  for (int i = 1; i <= n; ++i) {
    cin >> a[i];
  }
  long long dp[n + 1][4];
  dp[0][1] = 1000000000000000000;
  dp[0][2] = -d;
  dp[0][3] = 1000000000000000000;
  for (int i = 1; i <= n; ++i) {
    long long v = min(dp[i - 1][1], dp[i - 1][3]);
    long long k = dp[i - 1][2];
    dp[i][2] = v + min(min((a[i] + 2) * r[1], r[2] + r[1]), a[i] * r[1] + r[3]);
    dp[i][2] = min(dp[i][2], k + a[i] * r[1] + r[3]);
    if (i == n) {
      dp[i][2] = min(dp[i][2], v + a[i] * r[1] + r[3] - d);
    }
    dp[i][1] = k + 2 * d + (a[i] + 2) * r[1];
    dp[i][3] = k + 2 * d + r[2] + r[1];
    for (int j = 1; j <= 3; ++j) {
      dp[i][j] += d;
    }
  }
  long long ans = min(min(dp[n][1], dp[n][2]), dp[n][3]);
  cout << ans << endl;
  return 0;
}
