#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  int a[m], i, p = 1, u = 0, y = 0, j, s[m], g = 0, r;
  for (i = 0; i < m; i++) cin >> a[i];
  sort(a, a + m);
  for (i = 0; i < m - 1; i++) {
    if (a[i] == a[i + 1])
      p++;
    else {
      s[u] = p;
      u++;
      p = 1;
    }
  }
  s[u] = p;
  u++;
  sort(s, s + u);
  for (i = 1; i <= 100; i++) {
    for (j = 0; j < u; j++) y = y + s[j] / i;
    if (n <= y) g = i;
    y = 0;
  }
  if (n > m)
    cout << 0 << endl;
  else if (u == 1) {
    cout << s[0] / n << endl;
  } else
    cout << g << endl;
  return 0;
}
