#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef long double ld;
const ll N = 1e9 + 7, N1 = 2e5 + 7;
signed main() {
  ll n, m;
  cin >> n >> m;
  ll a[m];
  map<long long, long long> m1;
  for (long long i = 0; i < m; i++) {
    cin >> a[i];
    m1[a[i]]++;
  }
  ll cnt = 0, ans = 0;
  for (long long j = 1; j <= 100; j++) {
    cnt = 0;
    for (auto i = m1.begin(); i != m1.end() && cnt < n; i++) {
      cnt += (i->second / j);
    }
    if (cnt >= n)
      ans = j;
    else
      break;
  }
  cout << ans << "\n";
  return 0;
}
