#include <bits/stdc++.h>
using namespace std;
template <typename T, typename L>
inline bool smax(T &x, L y) {
  return x < y ? (x = y, true) : false;
}
template <typename T, typename L>
inline bool smin(T &x, L y) {
  return y < x ? (x = y, true) : false;
}
constexpr int MAXN = 1e5 + 15;
constexpr long long MAXM = 1e7 + 15;
long long n, x, y;
long long cnt[MAXM];
long long ps[MAXM];
long long ans = 1e15;
int main() {
  ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  cin >> n >> x >> y;
  for (long long i = 0; i < n; i++) {
    int rexy;
    cin >> rexy;
    cnt[rexy]++;
    ps[rexy] += rexy;
  }
  for (long long i = 1; i < MAXM; i++) {
    cnt[i] += cnt[i - 1];
    ps[i] += ps[i - 1];
  }
  for (long long g = 2; g < 1e6 + 1; g++) {
    long long rel = min(g, x / y + 1);
    long long cc = 0;
    for (long long j = 0; (j * g) < (MAXN * 15); j++) {
      long long rex = j * g + g;
      cc +=
          (x * (cnt[rex - rel] - cnt[rex - g]) +
           ((cnt[rex] - cnt[rex - rel]) * rex - (ps[rex] - ps[rex - rel])) * y);
    }
    smin(ans, cc);
  }
  return cout << ans << "\n", false;
}
