#include <bits/stdc++.h>
using namespace std;
int a[111], s1[111] = {0};
bool visited[111];
int n, k;
int main() {
  fill(visited, visited + 111, false);
  scanf("%d%d", &n, &k);
  for (int i = 0; i < k; i++) scanf("%d", &a[i]);
  sort(a, a + k);
  int l = k / n;
  for (int i = 0; i < k; i++) s1[a[i]]++;
  if (n > k)
    printf("0");
  else {
    int v = 1;
    for (int j = l; j >= 1; j--) {
      int c = 0;
      for (int i = 1; i <= 100; i++) {
        if (s1[i]) c += s1[i] / j;
      }
      if (c >= n) {
        v = 0;
        printf("%d", j);
        break;
      }
    }
    if (v == 1) printf("0");
  }
}
