#include <bits/stdc++.h>
using namespace std;
const int MX = 3e5 + 9;
long n, m, x, a[MX];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    cin >> x;
    a[x]++;
  }
  for (int ans = 100000; ans >= 1; ans--) {
    int n1 = n;
    for (int i = 1; i <= 100; i++) {
      n1 -= (a[i] / ans);
    }
    if (n1 > 0) continue;
    cout << ans << endl;
    return 0;
  }
  puts("0");
}
