#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 10;
const long long inf = 1e18;
const int mo = 998244353;
long long a[N], c1[N], c2[N];
long long dp[N];
int main() {
  long long n, r1, r2, r3, d;
  cin >> n >> r1 >> r2 >> r3 >> d;
  for (auto i = (1); i <= (n); ++i) {
    cin >> a[i];
    c1[i] = a[i] * r1 + r3 + d;
    c2[i] = min((a[i] + 2) * r1, r1 + r2) + 2 * d;
  }
  dp[0] = 0, dp[1] = c1[1];
  for (auto i = (2); i <= (n); ++i) {
    dp[i] = inf;
    dp[i] = min(dp[i], dp[i - 1] + c1[i]);
    dp[i] = min(dp[i], dp[i - 2] + c2[i] + c2[i - 1]);
  }
  dp[n] = min(dp[n], dp[n - 2] + c2[n - 1] + c1[n]);
  long long all2 = 0;
  for (auto i = (1); i <= (n); ++i) all2 += c2[i];
  cout << min(dp[n] - d, all2) << endl;
}
