#include <bits/stdc++.h>
using namespace std;
using namespace std;
char buff[200];
template <typename T>
void read(T& o) {
  o = 0;
  scanf("%s", buff);
  T f = 1;
  int i = 0;
  if (buff[0] == '-') i++, f = -1;
  for (; buff[i]; ++i) {
    o *= 10, o += buff[i] - '0';
  }
  o *= f;
}
template <typename T>
void write(T o) {
  int len = 0;
  buff[0] = '0';
  if (o == 0) {
    putchar('0');
    return;
  }
  int f = 1;
  if (o < 0) f = -1;
  o *= f;
  for (; o; o /= 10) buff[len++] = o % 10 + '0';
  if (f == -1) buff[len++] = '-';
  reverse(buff, buff + len);
  buff[len++] = '\0';
  printf("%s", buff);
}
const int maxn = 1000000 + 10;
const int maxb = 24;
const long long inf = 1e28;
const int mod = 998244353;
const int apsz = 26;
__int128 dp[2];
__int128 pre[2][2];
__int128 sum[3][maxn];
__int128 a[maxn];
__int128 d, r1, r2, r3;
int n;
inline void solve() {
  __int128 ans = inf;
  for (auto i = (1); i <= (n); ++i) {
    sum[0][i] = sum[0][i - 1] + r1 * a[i] + r3;
    sum[1][i] =
        sum[1][i - 1] + min(r1 * a[i] + r3, min(r1 * (a[i] + 1), r2) + r1);
  }
  int t = 0;
  dp[t] = -d;
  pre[1][0] = pre[1][1] = inf;
  pre[0][0] = dp[t];
  pre[0][1] = dp[t];
  for (auto i = (1); i <= (n); ++i) {
    dp[t ^ 1] = dp[t] + r1 * a[i] + r3 + d;
    if (i > 1)
      dp[t ^ 1] = min(dp[t ^ 1], dp[t] + 3 * d + min(r1 * (a[i] + 1), r2) + r1);
    dp[t ^ 1] = min(dp[t ^ 1], pre[1][0] + sum[0][i] + i * d + d);
    dp[t ^ 1] = min(dp[t ^ 1], pre[1][1] + sum[1][i] + (i - 1) * 3 * d + d);
    pre[1][0] = min(pre[0][0], pre[1][0]);
    pre[1][1] = min(pre[1][1], pre[0][1]);
    pre[0][0] = min(pre[0][0], dp[t ^ 1] - i * d - sum[0][i]);
    pre[0][1] = min(pre[0][1], dp[t ^ 1] - i * 3 * d - sum[1][i]);
    t ^= 1;
    if (i != n) {
      __int128 tmp = sum[1][n - 1] - sum[1][i] + (n - i) * 2 * d + d +
                     min(r1 * (a[n] + 1), r2) + r1;
      ans = min(ans, tmp + dp[t]);
      tmp =
          sum[1][n - 1] - sum[1][i] + (n - i - 1) * 2 * d + d + r1 * a[n] + r3;
      ans = min(ans, tmp + dp[t]);
    } else
      ans = min(ans, dp[t]);
  }
  write(ans);
}
int main(void) {
  scanf("%d", &(n));
  read(r1), read(r2), read(r3), read(d);
  for (auto i = (1); i <= (n); ++i) read(a[i]);
  solve();
  return 0;
}
