#include <bits/stdc++.h>
using namespace std;
int main() {
  list<unsigned long long int> blind;
  list<unsigned long long int>::iterator bite, tempite;
  unsigned long long int total, l, maxarea = 0, sum, i;
  cin >> total >> l;
  for (i = 0; i < total; ++i) {
    cin >> sum;
    if (sum >= l) blind.push_back(sum);
  }
  sum = 1;
  while (sum != 0) {
    sum = 0;
    for (bite = blind.begin(); bite != blind.end();) {
      if (*bite < l) {
        tempite = bite;
        ++bite;
        blind.erase(tempite);
      } else {
        sum += *bite / l;
        ++bite;
      }
    }
    if (maxarea < l * sum) maxarea = l * sum;
    ++l;
  }
  cout << maxarea;
  return 0;
}
