#include <bits/stdc++.h>
long long N, x, y;
long long sum[1005555 + 1], cnt[1005555 + 1];
long long gcnt(int r, int l) {
  if (r < l || l >= 1005555) return 0;
  r = ((r) > (1005555 - 1) ? (1005555 - 1) : (r));
  return cnt[r] - (l <= 0 ? 0 : cnt[l - 1]);
}
long long gsum(int r, int l) {
  if (r < l || l >= 1005555) return 0;
  r = ((r) > (1005555 - 1) ? (1005555 - 1) : (r));
  return sum[r] - (l <= 0 ? 0 : sum[l - 1]);
}
int main() {
  scanf("%lld%lld%lld", &N, &x, &y);
  for (int n = 0, in; n < N; n++) {
    scanf("%d", &in);
    sum[in] += in;
    cnt[in]++;
  }
  for (int n = 1; n <= 1005555; n++) {
    sum[n] += sum[n - 1];
    cnt[n] += cnt[n - 1];
  }
  long long ans = N * x;
  for (int g = 2; g < 1005555; g++) {
    int f = ((1) < (g - x / y) ? (g - x / y) : (1));
    long long query = 0;
    for (int plus = 0; plus < 1005555; plus += g) {
      query += gcnt(plus + f - 1, plus + 1) * x;
      query += (gcnt(plus + g - 1, plus + f) * ((plus + g) * 1LL) -
                gsum(plus + g - 1, plus + f)) *
               y;
    }
    ans = ((ans) > (query) ? (query) : (ans));
  }
  printf("%lld\n", ans);
  return 0;
}
