#include <bits/stdc++.h>
using namespace std;
int n, m, a[105], ha[105];
template <typename Drake>
void read(Drake &x) {
  x = 0;
  char ch = getchar();
  bool f = 1;
  while (!isdigit(ch)) {
    if (ch == '-') f ^= 1;
    ch = getchar();
  }
  while (isdigit(ch)) {
    x = (x << 1) + (x << 3) + (ch ^ 48);
    ch = getchar();
  }
  x *= (2 * f - 1);
}
template <typename Drake>
void write(Drake x) {
  if (x < 0) {
    x = -x;
    putchar('-');
  }
  if (x > 9) write(x / 10);
  putchar(x % 10 + '0');
}
template <typename Drake>
void writeln(Drake x) {
  write(x);
  puts("");
}
void init() {
  read(n);
  read(m);
  for (register int i = 1; i <= m; i++) read(a[i]), ha[a[i]]++;
}
int main() {
  memset(ha, 0, sizeof ha);
  init();
  for (register int i = m; i >= 1; i--) {
    int cnt = 0;
    for (register int j = 1; j <= 100; j++) cnt += ha[j] / i;
    if (cnt >= n) {
      cout << i << endl;
      return 0;
    }
  }
  puts("0");
  return 0;
}
