#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 50;
const int oo = 1e9;
const int mod = 1e9 + 7;
long long a[5 * N], sum[10 * N], cnt[10 * N];
int main() {
  long long n, x, y;
  cin >> n >> x >> y;
  long long z = x / y;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    cnt[a[i]]++;
    sum[a[i]] += a[i];
  }
  for (int i = 2; i < 10 * N; i++) {
    cnt[i] += cnt[i - 1];
    sum[i] += sum[i - 1];
  }
  long long ans = 1e18;
  for (long long i = 2; i < 10 * N; i++) {
    long long cur = 0;
    int lst = 1;
    for (long long j = i; j < 10 * N; j += i) {
      if (!(cnt[j] - cnt[lst - 1])) continue;
      long long q = j - z;
      if (q < lst) {
        cur += ((j * (cnt[j] - cnt[lst - 1])) - (sum[j] - sum[lst - 1])) * y;
      } else {
        cur += ((j * (cnt[j] - cnt[q - 1])) - (sum[j] - sum[q - 1])) * y;
        cur += (cnt[q - 1] - cnt[lst - 1]) * x;
      }
      lst = j + 1;
    }
    ans = min(ans, cur);
  }
  cout << ans << endl;
}
