#include <bits/stdc++.h>
using namespace std;
long long first, t[101], n, m, so;
vector<long long> f;
bool check(long long v) {
  long long d = 0;
  if (f.back() < v) return 0;
  for (long long i = (long long)0; i <= (long long)f.size() - 1; i++)
    d += f[i] / v;
  if (d >= n)
    return 1;
  else
    return 0;
}
int main() {
  cin >> n >> m;
  for (long long i = (long long)1; i <= (long long)m; i++) {
    cin >> first;
    t[first]++;
  }
  for (long long i = (long long)1; i <= (long long)100; i++) {
    if (t[i] != 0) {
      long long first = t[i];
      f.push_back(first);
    }
  }
  sort(f.begin(), f.end());
  so = 0;
  for (long long i = (long long)1; i <= (long long)100; i++)
    if (check(i))
      so = i;
    else
      break;
  cout << so;
}
