#include <bits/stdc++.h>
using namespace std;
const int maxn = 100;
int n, m, a[maxn];
int main() {
  cin >> n >> m;
  vector<int> c(maxn + 1);
  for (int i = 0; i < m; i++) {
    int x;
    cin >> x;
    c[x]++;
  }
  for (int d = maxn; d >= 1; d--) {
    vector<int> cc(c);
    int k = 0;
    for (int i = 1; i <= maxn; i++) {
      while (cc[i] >= d) {
        k++;
        cc[i] -= d;
      }
    }
    if (k >= n) {
      cout << d << endl;
      exit(0);
    }
  }
  cout << 0 << endl;
}
