#include <bits/stdc++.h>
using namespace std;
int a[105];
bool pan(int p, int q) { return p > q; }
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int b;
    scanf("%d", &b);
    a[b]++;
  }
  sort(a, a + 105, pan);
  int len = 0;
  for (int i = 0; i <= m; i++) {
    if (a[i] == 0) len = i;
  }
  int day = 0;
  for (int i = 1; i <= m; i++) {
    int k = 0;
    for (int j = 0; j < len; j++) {
      k += (a[j] / i);
    }
    if (k >= n)
      day++;
    else
      break;
  }
  printf("%d\n", day);
  return 0;
}
