#include <bits/stdc++.h>
using namespace std;
int a, b, c, n, m, sum = 0, num = 0, x[200];
char ch;
int main() {
  cin >> n >> m;
  memset(x, 0, sizeof(x));
  for (int i = 0; i < m; i++) {
    cin >> a;
    x[a]++;
  }
  b = m / n;
  while (b > 0) {
    for (int i = 1; i <= 100; i++) {
      sum += x[i] / b;
    }
    if (sum >= n) break;
    b--;
    sum = 0;
  }
  printf("%d\n", b);
}
