#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 9;
int a[N], r[3], n, d;
long long dp[N][2];
long long solve(int i = 0, int lst = 0) {
  if (i == n) return 0;
  long long &ret = dp[i][lst];
  long long e = (lst ? 0 : 2);
  if (~ret) return ret;
  ret = 1LL * r[0] * a[i] + r[2] + solve(i + 1, 0);
  ret = min(ret, 1LL * r[0] * (a[i] + 2) + e * d + solve(i + 1, !lst));
  ret = min(ret, r[1] + r[0] + e * d + solve(i + 1, !lst));
  if (i == n - 2) {
    long long tot = 1LL * r[0] * a[i + 1] + r[2];
    ret = min(ret, tot + 1LL * r[0] * (a[i] + 2) + d);
    ret = min(ret, tot + 1LL * r[1] + r[0] + d);
  }
  return ret;
}
int main() {
  memset(dp, -1, sizeof dp);
  scanf("%d", &n);
  for (int i = 0; i < 3; i++) scanf("%d", r + i);
  scanf("%d", &d);
  for (int i = 0; i < n; i++) scanf("%d", a + i);
  printf("%lld\n", solve() + 1LL * (n - 1) * d);
}
