#include <bits/stdc++.h>
using namespace std;
int a[122];
int main() {
  int res = 0, n, l, s = 0;
  scanf("%d%d", &n, &l);
  for (int i = 0; i < n; i++) scanf("%d", a + i), s += a[i];
  for (int i = l; i <= 100; i++) {
    int r = 0;
    for (int j = 0; j < n; j++) r += a[j] % i;
    res = max(res, s - r);
  }
  printf("%d\n", res);
  return 0;
}
