#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
const int maxm = 1e6 + 10;
const long long inf = 0x3f3f3f3f3f3f3f3f;
namespace io {
const int SIZE = (1 << 21) + 1;
char ibuf[SIZE], *iS, *iT, obuf[SIZE], *oS = obuf, *oT = oS + SIZE - 1, c,
                                       qu[55];
int f, qr;
inline void flush() {
  fwrite(obuf, 1, oS - obuf, stdout);
  oS = obuf;
}
inline void putc(char x) {
  *oS++ = x;
  if (oS == oT) flush();
}
template <typename A>
inline bool read(A &x) {
  for (f = 1, c = (iS == iT ? (iT = (iS = ibuf) + fread(ibuf, 1, SIZE, stdin),
                              (iS == iT ? EOF : *iS++))
                            : *iS++);
       c < '0' || c > '9';
       c = (iS == iT ? (iT = (iS = ibuf) + fread(ibuf, 1, SIZE, stdin),
                       (iS == iT ? EOF : *iS++))
                     : *iS++))
    if (c == '-')
      f = -1;
    else if (c == EOF)
      return 0;
  for (x = 0; c <= '9' && c >= '0';
       c = (iS == iT ? (iT = (iS = ibuf) + fread(ibuf, 1, SIZE, stdin),
                       (iS == iT ? EOF : *iS++))
                     : *iS++))
    x = x * 10 + (c & 15);
  x *= f;
  return 1;
}
inline bool read(char &x) {
  while ((x = (iS == iT ? (iT = (iS = ibuf) + fread(ibuf, 1, SIZE, stdin),
                           (iS == iT ? EOF : *iS++))
                        : *iS++)) == ' ' ||
         x == '\n' || x == '\r')
    ;
  return x != EOF;
}
inline bool read(char *x) {
  while ((*x = (iS == iT ? (iT = (iS = ibuf) + fread(ibuf, 1, SIZE, stdin),
                            (iS == iT ? EOF : *iS++))
                         : *iS++)) == '\n' ||
         *x == ' ' || *x == '\r')
    ;
  if (*x == EOF) return 0;
  while (!(*x == '\n' || *x == ' ' || *x == '\r' || *x == EOF))
    *(++x) = (iS == iT ? (iT = (iS = ibuf) + fread(ibuf, 1, SIZE, stdin),
                          (iS == iT ? EOF : *iS++))
                       : *iS++);
  *x = 0;
  return 1;
}
template <typename A, typename... B>
inline bool read(A &x, B &...y) {
  return read(x) && read(y...);
}
template <typename A>
inline bool write(A x) {
  if (!x) putc('0');
  if (x < 0) putc('-'), x = -x;
  while (x) qu[++qr] = x % 10 + '0', x /= 10;
  while (qr) putc(qu[qr--]);
  return 0;
}
inline bool write(char x) {
  putc(x);
  return 0;
}
inline bool write(const char *x) {
  while (*x) {
    putc(*x);
    ++x;
  }
  return 0;
}
inline bool write(char *x) {
  while (*x) {
    putc(*x);
    ++x;
  }
  return 0;
}
template <typename A, typename... B>
inline bool write(A x, B... y) {
  return write(x) || write(y...);
}
struct Flusher_ {
  ~Flusher_() { flush(); }
} io_flusher_;
}  // namespace io
using io ::putc;
using io ::read;
using io ::write;
long long a[maxm];
long long f[maxm][2], g[maxm];
long long min(long long a, long long b, long long c) {
  return min(a, min(b, c));
}
int main() {
  long long n, r1, r2, r3, k;
  read(n, r1, r2, r3, k);
  for (int i = 1; i <= n; i++) read(a[i]);
  f[1][0] = 1ll * a[1] * min(r1, r3) + r3;
  f[1][1] = inf;
  for (int i = 2; i <= n; i++) {
    f[i][0] = min(f[i - 1][0], f[i - 1][1]) + 1ll * a[i] * min(r1, r3) + r3 + k;
    f[i][1] =
        min(f[i - 2][0], f[i - 2][1]) + 4 * k +
        min(1ll * (a[i] + 2) * r1, 0ll + min(0ll + r2 + min(r1, r2, r3),
                                             1ll * a[i] * min(r1, r3) + r3)) +
        min(1ll * (a[i - 1] + 2) * r1, 0ll + r2 + min(r1, r2, r3));
    if (i == 2) f[i][1] -= k;
  }
  g[n] =
      min(1ll * a[n] * min(r1, r3) + r3,
          0ll + 2 * k + min(1ll * (a[n] + 2) * r1, 0ll + r2 + min(r1, r2, r3)));
  for (int i = n - 1; i >= 1; i--) {
    g[i] = g[i + 1] + 2 * k +
           min(1ll * (a[i] + 2) * r1,
               min(0ll + r2 + min(r1, r2, r3), 1ll * a[i] * min(r1, r3) + r3));
  }
  long long ans = min(f[n][0], f[n][1]);
  ans = min(ans, g[1]);
  for (int i = 1; i < n; i++) {
    ans = min(ans, min(f[i][0], f[i][1]) + k + g[i + 1]);
  }
  printf("%lld\n", ans);
  return 0;
}
