#include <bits/stdc++.h>
using namespace std;
const int maxn = 100 + 10;
int n, m, k, a[maxn];
int main() {
  scanf("%d%d", &n, &m);
  if (n > m) return puts("0"), 0;
  for (register int i = 1; i <= m; ++i) scanf("%d", &k), ++a[k];
  for (register int i = 1; i <= m; ++i) {
    int res = 0;
    for (register int j = 1; j <= 100; ++j) res += a[j] / i;
    if (res < n) {
      printf("%d\n", i - 1);
      return 0;
    }
  }
  printf("%d\n", m);
  return 0;
}
