#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  int a[m], i;
  int freq[105];
  for (i = 0; i < 105; i++) {
    freq[i] = 0;
  }
  for (i = 0; i < m; i++) {
    cin >> a[i];
    freq[a[i]]++;
  }
  vector<int> v;
  for (i = 0; i < 105; i++) {
    if (freq[i] != 0) {
      v.push_back(freq[i]);
    }
  }
  sort(v.begin(), v.end());
  reverse(v.begin(), v.end());
  int count = 0, ans = 0, j, flag = 0, k;
  for (k = 100; k > 0; k--) {
    count = 0;
    flag = 0;
    for (i = 0; i < v.size(); i++) {
      count += (v[i] / k);
      if (count >= n) {
        flag = 1;
        break;
      }
    }
    if (flag == 1) {
      ans = max(ans, k);
    }
  }
  cout << ans << endl;
  return 0;
}
