#include <bits/stdc++.h>
using namespace std;
long long sum[2000005];
int num[2000005];
bool life[2000005];
int main() {
  int n, x, y, t;
  long long ans, now;
  int n1, n2;
  long long sumg;
  scanf("%d%d%d", &n, &x, &y);
  ans = n * 1LL * x;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &t);
    sum[t] += t;
    num[t]++;
  }
  for (int i = 1; i <= 2000000; i++) {
    sum[i] += sum[i - 1];
    num[i] += num[i - 1];
  }
  for (int i = 2; i <= 1000000; i++) {
    if (life[i]) continue;
    now = 0;
    t = min(x / y, i - 1);
    for (int j = i; j - i < 1000000; j += i) {
      life[j] = 1;
      n1 = num[j - t - 1] - num[j - i];
      n2 = num[j] - num[j - t - 1];
      sumg = sum[j] - sum[j - t - 1];
      now += n1 * 1LL * x + (n2 * 1LL * j - sumg) * y;
    }
    ans = min(ans, now);
  }
  printf("%lld\n", ans);
  return 0;
}
