#include <bits/stdc++.h>
using namespace std;
int input, n, m;
map<int, int> num;
bool check(int x) {
  if (!x) return true;
  int t = 0;
  for (auto p : num) {
    t += p.second / x;
  }
  return t >= n;
}
int main(void) {
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    cin >> input;
    num[input]++;
  }
  int l = 0, r = 100, mid;
  while (l < r) {
    mid = (l + r + 1) >> 1;
    if (check(mid))
      l = mid;
    else
      r = mid - 1;
  }
  cout << l << endl;
  return 0;
}
