#include <bits/stdc++.h>
using namespace std;
long long int arr[1000000 + 6] = {};
long long int dp[1000000 + 6][2] = {}, a[1000000 + 6] = {}, b[1000000 + 6] = {};
int main() {
  ios_base::sync_with_stdio(false);
  std::cin.tie(NULL);
  std::cout.tie(NULL);
  ;
  long long int n, r1, r2, r3, d;
  cin >> n >> r1 >> r2 >> r3 >> d;
  for (int i = (0); i < (n); i += (1)) cin >> arr[i];
  for (int i = (1); i <= (n); i += (1)) {
    a[i] = min((arr[i - 1] + 1) * r1, r2) + r1;
    b[i] = arr[i - 1] * r1 + r3;
    dp[i][0] = min(dp[i - 1][0] + b[i], dp[i - 1][1] + min(a[i], b[i]) + 2 * d);
    dp[i][1] = dp[i - 1][0] + a[i];
  }
  long long int sum = b[n], ans = min(dp[n][0], dp[n][1] + 2 * d);
  for (int i = (n - 1); i >= (1); i -= (1)) {
    sum += a[i] + d;
    ans = min(ans, dp[i - 1][0] + sum);
  }
  cout << ans + (n - 1) * d << '\n';
  return 0;
}
