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