#include <bits/stdc++.h>
using namespace std;
const int N = 2e6 + 100;
long long a[N], sum[N], cnt[N], x, y, mx, n, an, ans = 1ll << 62, l, r;
int main() {
  scanf("%lld%lld%lld", &n, &x, &y);
  for (int i = 1; i <= n; i++) {
    scanf("%lld", &a[i]);
    sum[a[i]] += a[i];
    cnt[a[i]]++;
    mx = max(mx, a[i]);
  }
  if (mx == 1) {
    printf("%lld\n", n * min(x, y));
    return 0;
  }
  for (int i = 2; i < N; i++) sum[i] += sum[i - 1], cnt[i] += cnt[i - 1];
  for (long long i = 2; i <= mx; i++) {
    an = 0;
    for (long long j = i; j <= mx + i; j += i) {
      r = j - (long long)(ceil((double)x / (double)y) + 0.5);
      l = j - i + 1;
      if (r >= l)
        an += x * (cnt[r] - cnt[l - 1]);
      else
        r = l - 1;
      an += y * ((cnt[j] - cnt[r]) * j - (sum[j] - sum[r]));
    }
    ans = min(ans, an);
  }
  printf("%lld\n", ans);
  return 0;
}
