#include <bits/stdc++.h>
using namespace std;
int freq[105], dupfreq[105], food[105];
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 1; i <= 100; i++) freq[i] = 0;
  for (int i = 0; i < m; i++) {
    cin >> food[i];
    freq[food[i]]++;
  }
  int maxdays = floor(m / n);
  while (maxdays > 0) {
    int tempn = 0;
    for (int i = 1; i <= 100; i++) dupfreq[i] = freq[i];
    for (int i = 1; i <= 100; i++) {
      while (dupfreq[i] >= maxdays) {
        tempn++;
        dupfreq[i] -= maxdays;
      }
    }
    if (tempn >= n) break;
    maxdays--;
  }
  cout << maxdays;
  return 0;
}
