#include <bits/stdc++.h>
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
const int MOD = 1000000007;
int cnt[105];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, m;
  cin >> n >> m;
  for (int i = 1; i <= m; i++) {
    int x;
    cin >> x;
    cnt[x]++;
  }
  int ans = 0;
  for (int i = m; i > 0; i--) {
    int s = 0;
    for (int j = 1; j <= 100; j++) {
      s += cnt[j] / i;
    }
    if (s >= n) {
      ans = i;
      break;
    }
  }
  cout << ans << endl;
}
