#include <bits/stdc++.h>
using namespace std;
unsigned long long n;
unsigned long long r1, r2, r3, d;
unsigned long long cache[2000001][2];
vector<unsigned long long> v;
unsigned long long useMove;
unsigned long long useAWP;
unsigned long long killAll(int num) { return (num)*r1 + r3; }
unsigned long long movee(int num) { return min(r2, r1 * (num + 1)) + d; }
unsigned long long f(int cur, int prevExist) {
  if (cur == n && prevExist == 0) return 0;
  unsigned long long &ret = cache[cur][prevExist];
  if (ret != -1) return ret;
  ret = ULLONG_MAX - 1;
  if (prevExist) {
    unsigned long long case1 = killAll(v[cur]) + d + r1 + d + d + f(cur + 1, 0);
    unsigned long long case2 = movee(v[cur]) + r1 + d + r1 + d + f(cur + 1, 0);
    return ret = min(case1, case2);
  }
  unsigned long long case1 = killAll(v[cur]) + d + f(cur + 1, 0);
  unsigned long long case2 = movee(v[cur]) + f(cur + 1, 1);
  return ret = min(case1, case2);
}
int main() {
  cin >> n;
  cin >> r1 >> r2 >> r3 >> d;
  v.resize(n);
  for (int i = 0; i < n; i++) cin >> v[i];
  for (int i = 0; i < 2000000; i++) {
    cache[i][0] = -1;
    cache[i][1] = -1;
  }
  cache[n - 1][0] = min(killAll(v[n - 1]), movee(v[n - 1]) + d + r1);
  cache[n - 1][1] =
      min(killAll(v[n - 1]) + d + r1, movee(v[n - 1]) + r1 + d + r1);
  cout << f(0, 0) << '\n';
}
