#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e6 + 5;
int tab[MAXN], n;
struct Node {
  int cnt;
  long long sum;
} node[MAXN << 1];
Node combine(Node &a, Node &b) {
  Node tmp;
  tmp.cnt = a.cnt + b.cnt;
  tmp.sum = a.sum + b.sum;
  return tmp;
}
void build() {
  for (int i = n - 1; i > 0; --i)
    node[i] = combine(node[i << 1], node[i << 1 | 1]);
}
Node query(int l, int r) {
  r = min(r, n);
  Node res = {0, 0};
  for (l += n, r += n; l < r; l >>= 1, r >>= 1) {
    if (l & 1) res = combine(res, node[l++]);
    if (r & 1) res = combine(node[--r], res);
  }
  return res;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int a, m, x, y;
  cin >> m >> x >> y;
  for (int i = 0; i < m; i++) cin >> tab[i];
  n = *max_element(tab, tab + m) + 1;
  for (int i = 0; i < m; i++) {
    a = tab[i];
    node[n + a].cnt++;
    node[n + a].sum += a;
  }
  build();
  long long res = 1LL * m * x;
  a = x / y;
  Node tmp;
  for (int k = 2; k <= 1e6; k++) {
    long long cnt = 0;
    int p = min(k - 1, a);
    for (int z = k; z < 1e6 + k; z += k) {
      tmp = query(z - p, z);
      cnt += 1LL * x * query(z - k + 1, z - a).cnt +
             (1LL * tmp.cnt * z - tmp.sum) * y;
    }
    res = min(res, cnt);
  }
  cout << res;
}
