#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 10;
int n, r1, r2, r3, d;
long long f[N][3], val[N][2];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> r1 >> r2 >> r3 >> d;
  for (int i = 1; i <= n; i++) {
    int a;
    cin >> a;
    val[i][0] = 1ll * a * r1 + r3;
    val[i][1] = min(1ll * (a + 2) * r1, (long long)r2 + r1);
  }
  memset(f, 0x3f, sizeof(f));
  f[0][0] = 0;
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j <= 2; j++)
      for (int k = 0; k <= 2; k++) {
        if (j == 2 && k == 0) continue;
        if (j == 1 && k == 1) continue;
        if (j == 2 && k == 2) continue;
        f[i][j] = min(f[i][j], f[i - 1][k] + val[i][j >= 1] +
                                   d * ((j >= 1) + (j == 0 && k == 1)));
      }
  }
  f[n][1] += d;
  long long ans = 1e18;
  for (int i = 0; i <= 2; i++) ans = min(ans, f[n][i]);
  ans = min(ans, f[n - 1][1] + val[n][0]);
  cout << ans + 1ll * (n - 1) * d << '\n';
  return 0;
}
