#include <bits/stdc++.h>
using namespace std;
int gi() {
  int a;
  scanf("%d", &a);
  return a;
}
long long gli() {
  long long a;
  scanf("%I64d", &a);
  return a;
}
int f[100];
int main() {
  int p = gi();
  int n = gi();
  memset(f, 0, sizeof(f));
  for (int i = 0; i < n; i++) f[gi() - 1]++;
  int l = 1, r = n / p;
  while (l < r) {
    int m = (l + r + 1) / 2;
    int a = 0;
    for (int i = 0; i < 100; i++) a += f[i] / m;
    if (a >= p)
      l = m;
    else
      r = m - 1;
  }
  printf("%d\n", r);
  return 0;
}
