#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e6 + 100;
const double eps = 1e-8;
int n, m;
int a[110], b[110];
bool solve(int d) {
  for (int i = 1; i <= 100; i++) b[i] = a[i];
  int pos = 1, num = 0;
  while (pos <= 100) {
    while (pos <= 100 && b[pos] >= d) {
      b[pos] -= d, num++;
      if (num == n) return 1;
    }
    pos++;
  }
  return num == n;
}
int main() {
  while (~scanf("%d%d", &n, &m)) {
    memset(a, 0, sizeof(a));
    for (int i = 1; i <= m; i++) {
      int x;
      scanf("%d", &x);
      a[x]++;
    }
    if (m < n) {
      printf("0\n");
      continue;
    }
    int num = 0;
    for (int i = 1; i <= 100; i++) {
      if (solve(i)) {
        num = max(num, i);
      }
    }
    printf("%d\n", num);
  }
}
