#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 5;
long long a[N];
long long dp[N][3];
int main() {
  long long n, r1, r2, r3, d;
  cin >> n >> r1 >> r2 >> r3 >> d;
  for (long long i = 1; i <= n; i++) {
    cin >> a[i];
  }
  long long x = 0, y = 0;
  dp[1][0] = r3 + a[1] * r1;
  dp[1][1] = 1e18;
  dp[1][2] = min(r2, (a[1] + 1) * r1) + 2 * d + r1;
  for (long long i = 2; i <= n; i++) {
    x = r3 + a[i] * r1;
    y = min(r2, (a[i] + 1) * r1) + r1;
    if (i < n) {
      dp[i][0] = min(dp[i - 1][0], min(dp[i - 1][1], dp[i - 1][2])) + x + d;
    } else {
      dp[i][0] = min(min(dp[i - 1][0], dp[i - 1][1]) + d, dp[i - 1][2]) + x;
    }
    dp[i][1] =
        min(min(dp[i - 1][0], dp[i - 1][1]) + 2 * d, dp[i - 1][2]) + d + y;
    dp[i][2] = min(min(dp[i - 1][0], dp[i - 1][1]), dp[i - 1][2]) + y + 3 * d;
  }
  cout << min(dp[n][0], dp[n][1]);
  return 0;
}
