#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
template <class T>
inline void amin(T &x, const T &y) {
  if (y < x) x = y;
}
template <class T>
inline void amax(T &x, const T &y) {
  if (x < y) x = y;
}
template <class Iter>
void rprintf(const char *fmt, Iter begin, Iter end) {
  for (bool sp = 0; begin != end; ++begin) {
    if (sp)
      putchar(' ');
    else
      sp = true;
    printf(fmt, *begin);
  }
  putchar('\n');
}
int N;
long long A[1000011];
long long Pistol, Laser, AWP;
long long D;
long long dp1[1000011];
long long dp2[1000011];
void MAIN() {
  scanf("%d", &N);
  scanf("%lld%lld%lld%lld", &Pistol, &Laser, &AWP, &D);
  for (int i = 0, i_len = (N); i < i_len; ++i) scanf("%lld", A + i);
  memset(dp1, 0x3f, sizeof dp1);
  memset(dp2, 0x3f, sizeof dp2);
  dp1[0] = -D;
  for (int i = 0, i_len = (N); i < i_len; ++i) {
    amin(dp1[i + 1], D + dp1[i] + A[i] * Pistol + AWP);
    if (i + 2 <= N) {
      long long cst = dp1[i];
      cst += D + min((A[i] + 1) * Pistol, Laser);
      cst += D + min((A[i + 1] + 1) * Pistol, Laser);
      cst += D + Pistol;
      cst += D + Pistol;
      amin(dp1[i + 2], cst);
    }
    if (i || i + 2 <= N) {
      long long cst = dp1[i];
      cst += D + min((A[i] + 1) * Pistol, Laser);
      cst += D;
      cst += D + Pistol;
      amin(dp1[i + 1], cst);
    }
    if (i + 2 <= N) {
      long long cst = 0;
      cst += D + min((A[i] + 1) * Pistol, Laser);
      cst += D + Pistol;
      amin(dp2[i + 1], cst + dp1[i]);
      amin(dp2[i + 1], cst + dp2[i]);
      cst = 0;
      cst += D + A[i] * Pistol + AWP;
      cst += D;
      amin(dp2[i + 1], cst + dp2[i]);
    }
  }
  long long ans = dp1[N];
  if (N >= 2) {
    int i = N - 1;
    long long cst = 0;
    cst += D + min((A[i] + 1) * Pistol, Laser);
    cst += D;
    cst += D + Pistol;
    amin(ans, cst + dp2[i]);
    cst = 0;
    cst += D + A[i] * Pistol + AWP;
    amin(ans, cst + dp2[i]);
  }
  printf("%lld\n", ans);
}
int main() {
  int TC = 1;
  for (int tc = 0, tc_len = (TC); tc < tc_len; ++tc) MAIN();
  return 0;
}
