#include <bits/stdc++.h>
using namespace std;
int main() {
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);
  int n, e;
  long *x;
  int i;
  long total, gain;
  int a;
  cin >> n >> e;
  x = new long[n];
  total = 0;
  for (i = 0; i < n; ++i) {
    cin >> x[i];
    total += e * 2 + x[i] * 5;
  }
  a = 0;
  for (i = n - 2; i >= 0; --i) {
    gain = x[i] * a - e;
    if (gain < 0) {
      total += gain;
      a += 2;
    } else
      a = 0;
  }
  cout << total << endl;
  return 0;
}
