#include <bits/stdc++.h>
using namespace std;
bool comp(int a, int b) { return a > b; }
int f[101];
int main() {
  int n;
  int m;
  cin >> n >> m;
  int a[m];
  for (long long i = 0; i < m; i++) {
    cin >> a[m];
    f[a[m]]++;
  }
  if (n > m) {
    cout << "0" << endl;
    return 0;
  }
  sort(f, f + 101, comp);
  vector<int> v;
  int j = 0;
  while (f[j] != 0) {
    v.push_back(f[j]);
    j++;
  }
  long long last = 0;
  long long cnt = 0;
  long long s = 0;
  for (long long i = 1; i <= 100; i++) {
    s = 0;
    for (long long j = 0; j < v.size(); j++) {
      s += (v[j] / i);
      if (s >= n) {
        last = i;
        break;
      }
    }
    if (s < n) {
      break;
    }
  }
  cout << last << endl;
  return 0;
}
