#include <bits/stdc++.h>
using namespace std;
const long long MAXN = 1E6 + 1, INF = 1E17;
long long n, r1, r2, r3, d, a[MAXN];
long long dp[MAXN][3];
long long aoe() { return r2 + r1; }
long long pass(long long i) { return r1 * a[i] + r3; }
long long pistol(long long i) { return r1 * (a[i] + 2); }
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n >> r1 >> r2 >> r3 >> d;
  for (long long i = 1; i <= n; i++) {
    cin >> a[i];
  }
  dp[0][0] = -1 * d;
  dp[0][1] = INF;
  dp[0][2] = INF;
  for (long long i = 1; i < n; i++) {
    dp[i][0] = min(dp[i - 1][0] + d + pass(i),
                   dp[i - 1][2] + d * 3 + min(aoe(), min(pass(i), pistol(i))));
    dp[i][1] = min(dp[i - 1][0] + d + min(aoe(), pistol(i)),
                   dp[i - 1][1] + d * 2 + min(aoe(), min(pass(i), pistol(i))));
    dp[i][2] = min(dp[i - 1][0] + d + min(aoe(), pistol(i)),
                   dp[i - 1][2] + d * 3 + min(aoe(), min(pass(i), pistol(i))));
  }
  long long ans = min(dp[n - 1][0] + d + pass(n),
                      min(dp[n - 1][1] + d * 2 + pass(n),
                          dp[n - 1][2] + d * 3 + min(aoe(), pistol(n))));
  cout << ans << "\n";
  return 0;
}
