#include <bits/stdc++.h>
using namespace std;
long long a[1000000], b[1000000], x[1000000], n, p, q, sum;
int main() {
  cin >> n >> p >> q;
  a[0] = p * q;
  for (int i = 0; i < n; i++) {
    cin >> b[i];
  }
  for (int i = 1; i < n; i++) {
    a[i] = a[i - 1] + p;
  }
  for (int i = 0; i < n; i++) {
    if (a[i] >= b[i] * 2 / 3) {
      x[i] = 1;
    } else {
      x[i] = 0;
    }
  }
  for (int i = 0; i < n; i++) {
    if (x[i] == 1) {
      sum += p * q;
      q++;
    } else {
      sum += b[i];
      q--;
    }
  }
  cout << sum << endl;
  return 0;
}
