#include <bits/stdc++.h>
using namespace std;
int n, m, a[102];
int main() {
  cin >> n >> m;
  for (int i = 1; i <= m; i++) {
    int x;
    cin >> x;
    a[x]++;
  }
  vector<int> aa;
  for (int i = 1; i <= 100; i++) {
    if (a[i] > 0) aa.push_back(a[i]);
  }
  sort(aa.begin(), aa.end());
  for (int i = 10000; i >= 1; i--) {
    int k = n;
    for (int j = aa.size() - 1; j > -1; j--) k -= aa[j] / i;
    if (k <= 0) return cout << i, 0;
  }
  cout << 0;
  return 0;
}
