#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int i, j, k, n, m, t, sum = 0, ans = 0;
  bool f = 0, flag = 0;
  cin >> m >> n;
  long long int a[n + 1];
  map<long long int, long long int> mm;
  for (i = 0; i < n; i++) {
    cin >> a[i];
    mm[a[i]]++;
  }
  map<long long int, long long int>::iterator it;
  long long int start = 0, End = 100, mid = 0;
  if (m > n)
    cout << 0 << endl;
  else {
    long long int al = 0;
    for (; start <= End;) {
      mid = (start + End) / 2;
      if ((start + End) % 2 == 1) mid++;
      f = 0;
      ans = m;
      for (it = mm.begin(); it != mm.end() && ans; it++) {
        if (it->second >= mid) {
          ans -= (it->second) / mid;
        }
      }
      if (ans > 0)
        f = 1;
      else
        al = max(al, mid);
      if (f)
        End = mid - 1;
      else
        start = mid + 1;
    }
    cout << al << endl;
  }
  return 0;
}
