#include <bits/stdc++.h>
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math")
using namespace std;
template <class t>
inline t read(t &x) {
  char c = getchar();
  bool f = 0;
  x = 0;
  while (!isdigit(c)) f |= c == '-', c = getchar();
  while (isdigit(c)) x = (x << 1) + (x << 3) + (c ^ 48), c = getchar();
  if (f) x = -x;
  return x;
}
template <class t, class... A>
inline void read(t &x, A &...a) {
  read(x);
  read(a...);
}
template <class t>
inline void write(t x) {
  if (x < 0)
    putchar('-'), write(-x);
  else {
    if (x > 9) write(x / 10);
    putchar('0' + x % 10);
  }
}
const long long N = 1e6 + 5;
long long n, a, b, c, d, p[N], f[N][2];
signed main() {
  read(n, a, b, c, d);
  long long ac = min(a, c), abc = min(ac, b);
  for (long long i = 1; i <= n; i++) read(p[i]);
  for (long long i = 1, last = 0; i <= n; i++) {
    long long base = i == 1   ? 0
                     : i == 2 ? f[i - 1][0] + d
                              : min(f[i - 2][1] + d * 2, f[i - 1][0] + d);
    f[i][0] = base + min(ac * p[i] + c, min(b, ac * (p[i] + 1)) + d + d + abc);
    if (i > 1)
      f[i][0] = min(f[i][0], last + min(b, ac * p[i - 1] + a) + d +
                                 min(b, ac * p[i] + a) + d + abc + d + abc);
    if (i < n)
      f[i][1] = base + min(b, ac * p[i] + a) + d + ac * p[i + 1] + c + d + abc;
    last = base;
  }
  write(min(f[n - 1][1], f[n][0]));
}
