#include <bits/stdc++.h>
using namespace std;
const int N = 10010;
int a[N];
int n, m, cnt = 0, ans = 0, sum = 0;
int main() {
  cin >> n >> m;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  for (int i = m; i <= 100; i++) {
    sum = 0;
    for (int j = 1; j <= n; j++) sum = sum + a[j] / i;
    ans = max(ans, sum * i);
  }
  cout << ans;
  return 0;
}
