#include <bits/stdc++.h>
using namespace std;
int n, m, a[100005], ans;
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  for (int i = m; i <= 100; i++) {
    int cnt = 0;
    for (int j = 1; j <= n; j++) cnt += a[j] / i;
    ans = max(ans, i * cnt);
  }
  printf("%d\n", ans);
  return 0;
}
