#include <bits/stdc++.h>
using namespace std;
int count_ushiro(const vector<int>& s, int t) {
  int cnt = 0;
  if (!s.empty()) {
    for (int i = 0; i < s.size(); i++) {
      if (s[i] > t) cnt++;
    }
  }
  return cnt;
}
int main() {
  int n, p, q;
  cin >> n >> p >> q;
  vector<pair<int, int>> c(n);
  for (int i = 0; i < n; i++) {
    cin >> c[i].first;
    c[i].second = i;
  }
  long long ans = p * (q * 2 + n - 1) * n / 2;
  sort(c.begin(), c.end(), greater<pair<int, int>>());
  vector<int> shokudou(n);
  for (auto t : c) {
    int toku = t.first;
    int son = p * ((q + t.second) + 2 * (n - t.second - 1));
    son -= count_ushiro(shokudou, t.second) * p * 2;
    if (toku > son) {
      ans += toku - son;
      shokudou.push_back(t.second);
    }
  }
  cout << ans << endl;
}
