#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> a(m);
  vector<int> b(101);
  fill(b.begin(), b.end(), 0);
  for (int i = 0; i < m; i++) {
    cin >> a[i];
    b[a[i]]++;
  }
  if (m < n) {
    cout << 0 << endl;
    return 0;
  }
  sort(b.begin(), b.end(), greater<int>());
  vector<int> ans;
  for (int i = 1;; i++) {
    int sum = 0;
    for (int j = 0; j <= 100; j++) {
      if (b[j] == 0) break;
      int sub = b[j] / i;
      if (sub < 1) break;
      sum += sub;
      if (sum >= n) break;
    }
    if (sum >= n)
      ans.push_back(i);
    else
      break;
  }
  if (ans.empty()) {
    cout << 0 << endl;
    return 0;
  }
  sort(ans.begin(), ans.end(), greater<int>());
  cout << ans[0] << endl;
}
