#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
const int N = 1000005;
int power(int b, int exp) {
  int res = 1;
  while (exp > 0) {
    if (exp % 2) {
      res = 1LL * res * b % mod;
    }
    b = 1LL * b * b % mod;
    exp /= 2;
  }
  return res;
}
int test = 1, n;
long long dp[N][2], r1, r2, r3, d, a[N];
long long fun(int idx, int prev) {
  long long &ret = dp[idx][prev];
  if (ret != -1) {
    return ret;
  }
  long long cost = r3 + 1LL * a[idx] * r1;
  if (idx == n) {
    ret = cost + prev * (d + min(r1, r2));
    cost = min(r2, r1 * (a[idx] + 1));
    cost += 2 * d + prev * min(r1, r2) + min(r1, r2);
    ret = min(ret, cost);
    return ret;
  }
  cost += prev * (2 * d + min(r1, r2));
  ret = cost + d + fun(idx + 1, 0);
  cost = min(r2, r1 * (a[idx] + 1));
  if (idx < n) {
    cost += 1LL * prev * (2LL * d + min(r1, r2));
    ret = min(ret, cost + d + fun(idx + 1, 1));
  } else {
    cost += 2 * d + prev * min(r1, r2);
  }
  if (prev == 0) {
    cost += 2 * d;
  }
  ret = min(ret, cost + d + r1 + fun(idx + 1, 0));
  return ret;
}
int main() {
  while (test--) {
    memset(dp, -1, sizeof(dp));
    scanf("%d %lld %lld %lld %lld", &n, &r1, &r2, &r3, &d);
    r1 = min(r1, r3);
    for (int i = 1; i <= n; i++) {
      scanf("%lld", &a[i]);
    }
    printf("%lld\n", fun(1, 0));
  }
  return 0;
}
