#include <bits/stdc++.h>
using namespace std;
const int N = 5e5 + 10;
const int N2 = 2e6 + 5;
long long cs[N2], csn[N2];
int main() {
  int n, x, y;
  scanf("%d%d%d", &n, &x, &y);
  int mx = 0;
  for (int i = 0, a; i < n; i++) {
    scanf("%d", &a);
    cs[a]++;
    mx = max(mx, a);
  }
  long long temp = 0;
  int am = 0;
  for (int i = 1; i < N2; i++) {
    if (cs[i]) am += cs[i];
    cs[i] += cs[i - 1];
    csn[i] = temp;
    temp += am;
  }
  int d = x / y;
  for (int i = d - 2; i <= d + 2; i++) {
    if (1LL * i * y < x) d = i;
  }
  long long ans = 1e18;
  for (int i = 2; i < N2; i++) {
    int h = min(d, i - 1), g = 0;
    long long s = 0;
    for (int j = i; j < N2; j += i) {
      g += cs[j] - cs[max(j - h - 1, 0)];
      s += csn[j] - csn[max(j - h - 1, 0)] -
           cs[max(j - h - 1, 0)] * 1LL * (h + 1);
    }
    ans = min(ans, y * s + x * 1LL * (n - g));
  }
  cout << ans << endl;
  return 0;
}
