#include <bits/stdc++.h>
using namespace std;
int main() {
  int ans = 0;
  int n, m;
  cin >> n >> m;
  map<int, int> type;
  vector<int> a(m);
  for (int i = 0; i < m; i++) {
    cin >> a[i];
    type[a[i]] += 1;
  }
  int sum = accumulate(a.begin(), a.end(), 0);
  int mel = 0;
  for (auto p : type) {
    mel = max(mel, p.second);
  }
  for (int i = 1; i <= mel; i++) {
    int curr = 0;
    for (auto p : type) {
      curr += p.second / i;
    }
    if (curr >= n) {
      ans = max(ans, i);
    }
  }
  cout << ans;
}
