#include <bits/stdc++.h>
using namespace std;
long long int coun[2000005], sum[2000005], n, x, y, maxx;
long long int go1(long long int l, long long int r) {
  if (l > r) return 0;
  return (coun[r] - coun[l - 1]);
}
long long int go2(long long int l, long long int r) {
  if (l > r) return 0;
  return (sum[r] - sum[l - 1]);
}
long long int go(long long int g) {
  long long int k = g, res = 0;
  while (k <= (1000000 + g)) {
    long long int first = max(k - g + 1, k - (x / y));
    res += go1(k - g + 1, first - 1) * x;
    res += (go1(first, k) * k - go2(first, k)) * y;
    k += g;
  }
  return res;
}
int main() {
  scanf("%lld", &n);
  scanf("%lld", &x);
  scanf("%lld", &y);
  for (int i = 0; i < n; i++) {
    long long int t;
    scanf("%lld", &t);
    coun[t]++;
    sum[t] += t;
  }
  for (int i = 1; i <= 2000005 - 1; i++) {
    coun[i] += coun[i - 1];
    sum[i] += sum[i - 1];
  }
  long long int res = n * x;
  for (long long int i = 2; i <= 1000000; i++) {
    res = min(res, go(i));
  }
  printf("%lld\n", res);
  return 0;
}
