#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("O2")
long long dpL[1000001], dpR[1000001], one[1000001], two[1000001], ans;
long long n, r1, r2, r3, d, a[1000001];
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0);
  cin >> n >> r1 >> r2 >> r3 >> d;
  for (long long i = (1); i < (n + 1); i++) cin >> a[i];
  for (long long i = (1); i < (n + 1); i++) {
    one[i] = a[i] * r1 + r3;
    two[i] = min((a[i] + 2) * r1, r1 + r2);
  }
  dpL[0] = -d;
  for (long long i = (1); i < (n + 1); i++) {
    dpL[i] = dpL[i - 1] + d + one[i];
    if (i >= 2)
      dpL[i] = min(dpL[i - 1] + d + one[i], dpL[i - 2] + 4 * d +
                                                min(one[i - 1], two[i - 1]) +
                                                min(one[i], two[i]));
  }
  dpR[n] = min(one[n], two[n] + 2 * d);
  for (long long i = (n - 1); i > (0); i--)
    dpR[i] = dpR[i + 1] + 2 * d + min(one[i], two[i]);
  ans = dpL[n];
  for (long long i = (1); i < (n + 1); i++)
    ans = min(ans, dpL[i - 1] + dpR[i] + d);
  cout << ans << "\n";
  return 0;
}
