#include <bits/stdc++.h>
using namespace std;
const int N = 101;
int n, m, a, i, mx, cnt[N];
vector<int> vec;
bool check(int days) {
  int rem = n;
  for (int i = 0; i < vec.size(); ++i) {
    rem -= (vec[i] / days);
  }
  return (rem <= 0);
}
int main() {
  cin >> n >> m;
  for (i = 0; i < m; ++i) {
    cin >> a;
    cnt[a]++;
  }
  for (i = 0; i < N; ++i) {
    if (cnt[i] > 0) {
      vec.push_back(cnt[i]);
      mx = max(mx, cnt[i]);
    }
  }
  sort(vec.rbegin(), vec.rend());
  for (i = mx; i > 0; --i) {
    if (check(i)) {
      return cout << i, 0;
    }
  }
  cout << 0;
  return 0;
}
