#include <bits/stdc++.h>
using namespace std;
long long n, x, y, z, a[1000000], b[100000], k, sum = 0, sol = 0;
vector<long long> v;
map<char, int> m;
map<char, int> mm;
int main() {
  cin >> n >> k;
  for (int i = 0; i < k; i++) {
    cin >> a[i];
    b[a[i]]++;
  }
  sort(b, b + 100 + 2);
  for (int i = 100 + 3; i >= 0; i--) {
    if (b[i] > 0) v.push_back(b[i]);
  }
  for (long long i = 1; i <= 1000; i++) {
    sum = 0;
    for (long long q = 0; q < v.size(); q++) {
      sum += v[q] / i;
    }
    if (sum >= n) sol = max(sol, i);
  }
  cout << sol << endl;
  return 0;
}
