#include <bits/stdc++.h>
using namespace std;
int N, M, a[105], ii, psum[105];
int main(void) {
  scanf("%d %d", &N, &M);
  int c, aaaa = 0;
  for (int i = 0; i < M; i++) {
    scanf("%d", &c);
    if (!a[c]) ii++;
    a[c]++;
    if (aaaa < a[c]) aaaa = a[c];
  }
  sort(a + 1, a + 101, [](int A, int B) { return A > B; });
  int s = 0;
  for (int i = 1; i <= ii; i++) s += a[i];
  int l = 1, r = aaaa, rrrr = 0;
  while (l <= r) {
    int m = (l + r) / 2, ss = 0;
    for (int i = 1; i <= ii; i++) {
      ss += a[i] / m;
    }
    if (ss < N) {
      r = m - 1;
    } else {
      rrrr = max(m, rrrr);
      l = m + 1;
    }
  }
  printf("%d", rrrr);
  return 0;
}
