#include <bits/stdc++.h>
long long n, a, b, c, d;
long long x[1000000];
long long s, t, u, v, ss, tt, m, p;
int main() {
  scanf("%lld%lld%lld%lld%lld", &n, &a, &b, &c, &d);
  for (int i = 0; i < n; i++) {
    scanf("%lld", x + i);
  }
  s = a * x[0] + c;
  t = a + b;
  if (t > (a * x[0] + 2 * a)) t = a * x[0] + 2 * a;
  for (int i = 1; i < n; i++) {
    u = a + b;
    v = a * x[i] + c;
    if (u > (a * x[i] + 2 * a)) u = a * x[i] + 2 * a;
    tt = s + u + d;
    ss = s + v + d;
    if (ss > t + u + 3 * d) ss = t + u + 3 * d;
    s = ss;
    t = tt;
  }
  if (s > t + 2 * d) s = t + 2 * d;
  m = s;
  if (n > 2) {
    p = a + b + a * x[n - 1] + c + 3 * d;
    if (p > 2 * a + x[n - 2] * a + a * x[n - 1] + c + 3 * d) {
      p > 2 * a + x[n - 2] * a + a* x[n - 1] + c + 3 * d;
    }
    s = a * x[0] + c;
    t = a + b;
    for (int i = 1; i < n - 2; i++) {
      u = a + b;
      v = a * x[i] + c;
      if (u > (a * x[i] + 2 * a)) u = a * x[i] + 2 * a;
      tt = s + u + d;
      ss = s + v + d;
      if (ss > t + u + 3 * d) ss = t + u + 3 * d;
      s = ss;
      t = tt;
    }
  } else {
    s = 0;
    p = a + b + a * x[1] + c + 2 * d;
    if (p > 2 * a + x[0] * a + a * x[1] + c + 2 * d) {
      p = 2 * a + x[0] * a + a * x[1] + c + 2 * d;
    }
  }
  if (m > s + p) m = s + p;
  printf("%lld\n", m);
}
