#include <bits/stdc++.h>
using namespace std;
long long n, r1, r2, r3, d, a[1000010], dp[1000010];
int main() {
  cin >> n >> r1 >> r2 >> r3 >> d;
  for (int i = 1; i <= n; i++) cin >> a[i];
  memset(dp, 0x7f7f7f7f7f7f, sizeof(dp));
  dp[1] = 0;
  for (int i = 1; i <= n; i++) {
    dp[i + 1] = min(dp[i + 1], dp[i] + min((a[i] + 1) * r1, r2) + 3 * d + r1);
    dp[i + 1] = min(dp[i + 1], dp[i] + r1 * a[i] + r3 + d);
    dp[i + 2] =
        min(dp[i + 2], dp[i] + min((a[i] + 1) * r1, r2) + d +
                           min((a[i + 1] + 1) * r1, r2) + d + r1 + d + r1 + d);
  }
  cout << min(dp[n + 1] - d, dp[n - 1] + min((a[n - 1] + 1) * r1, r2) + d +
                                 r1 * a[n] + r3 + d + r1)
       << endl;
  return 0;
}
