#include <bits/stdc++.h>
using namespace std;
const int maxn = 123;
int a[maxn];
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 1; i <= m; i++) {
    int x;
    cin >> x;
    a[x]++;
  }
  int ans = 0;
  for (int i = 100; i >= 1; i--) {
    int man = 0;
    for (int j = 1; j <= 100; j++) {
      man += a[j] / i;
    }
    if (man >= n) {
      ans = max(ans, i);
    }
  }
  cout << ans << endl;
  return 0;
}
